-
-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error handling story #168
Comments
I'm sorry, apparently I also can't quite understand what you're trying to do. Care to explain a little more? |
Right off the bat, I'm converting a fallible filter to an infallible one that extracts a result...
...so that I can get authentication from the request.
Then to actually process the error, I match on the result...
...with success continuing through...
...and errors being pulled out, with a passed-in
The authentication object and the flashes are added to the context used to render the template...
...and the corresponding errors are enabled...
...then the error template page is rendered to a
(If the function didn't handle the error, pass it along.)
(If the error was of the wrong type, pass it along.)
Really, my main gripes are:
|
Thanks for the breakdown! I really understand what is going on now. I'll give this problem some thought, but do you have any suggestions? |
idk how much implementation effort it would be, but some way to get a Filter for recovery, like: foo()
.and(bar())
.and_then(...)
.or(recover().and_then(...)) and probably a |
Right now, I'm handling errors in an (HTMLful) warp app with the following helper:
https://github.com/remexre/nihctfplat/blob/e10ef2befe1bfa07373096b511e81e35284d708e/src/router/util.rs#L56-L96
I'm naturally not thrilled about this; #165 is largely about mitigating the need for the
.map(Ok).recover(|e| Ok(Err(e))).unify().and(auth::opt_auth())
; is there a nicer way to do something like this that I'm not seeing?The text was updated successfully, but these errors were encountered: