-
-
Notifications
You must be signed in to change notification settings - Fork 8
More idiomatic errors. #13
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersnext-goal-v0.x.0Defines a goal for the next minor version.Defines a goal for the next minor version.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersnext-goal-v0.x.0Defines a goal for the next minor version.Defines a goal for the next minor version.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Program Version.
Pre-alpha
Problem Description.
Errors can be much more idiomatic and understandable.
Just in case you've never heard of this feature, see for instance, in another (proprietary) software of mine,
Since there is a
fromfor this error, the error can be automatically casted on lift.Take for instance this controller:
CourseModel::join(...)returns aResult<RelationalCourse, DieselError>but because of theFromfor typeDieselErrorimplemented on theHttpErrorenum, it automatically casts it on lift.Problem Solutions.
Add a
Fromimpl for a custom error type which matches all error types we're catching to an HTTP status code according to the type of error.Other Details.
You can find this in here. This should pretty much all be replaced.