-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
Labels
featureNew feature or requestNew feature or request
Description
I get the impression that the rejection system in this crate ought to be severely refactored. The rejections example does not show a simple way of handling functions which return Results
:
async fn login(credentials: Credentials) -> Result<UserSession, LoginError> {
...
}
which is the standard way of handling Errors in Rust. The suggested way of handling this seems to be to
- implement
Reject for LoginError
(which requires me to own theLoginError
type) - call
recover
after the handling filter with a "rejection handler" function, which converts rejections into aReply
type which can be sent by warp
This causes a lot of cognitive and syntactic overhead, and I think the crate would benefit a lot from a refactor like this.
Yoric, indiv0, m9xiuz, nmrshll, okorolko and 22 more
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request