You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to have an example with proper error handling.
E.g. how can I use a custom AppError within my routes? I'd like to write something like
fnpost_foo<'a>(req:&mut nickel::Request<Data>,res: nickel::Response<'a,Data>)
-> MiddlewareResult<'a,Data>{let db = res.server_data().db.clone();let foo = try!(something(&pool));let bar = try!(precedure(&foo));
try!(baz(bar))}
Each of the methods return a AppError and somewhere central would be a custom mapping of the HTTP status codes and error messages. How can I achieve this?
The text was updated successfully, but these errors were encountered:
It would be great to have an example with proper error handling.
E.g. how can I use a custom
AppError
within my routes? I'd like to write something likeEach of the methods return a
AppError
and somewhere central would be a custom mapping of the HTTP status codes and error messages. How can I achieve this?The text was updated successfully, but these errors were encountered: