-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
impl Reject for T: Display + Debug #374
Conversation
When I redesigned the rejection system, one of my goals was to make rejection explicit. To make someone decide if the route should be rejected, and thus other routes should be tried, or if their error should be converted into a reply. |
oh, yeah I just realized reading reject.rs:L128 that it was assumed 👍 |
@seanmonstar What initially raised this was #307, I'm curious what you'd recommend to support rejections then for types foreign to the crate (like with |
@udoprog if the filter should reject and try another filter, then sure. You can define some type that you'd expect to look for later in a |
|
I'll be referencing the My goal with rejections have never been try another filter. The way I've implemented error handling in my project is to recover immediately at the end of each unique filter to limit the number of retries. The If so, some dedicated mechanism for propagating errors down to an error handler without trying other filters might be worth considering (if one doesn't already exist?). In my experience that is currently the dominant use case for custom reject/recover. Two other people I've talked to about error handling in warp have been tripped by this so far. |
@seanmonstar I'd be curious on your take of the above? |
impl std::error::Error
to not needimpl Reject for T {}
so that anyhow! dependency becomes unnecessary