Skip to content
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

ErrorResponse can't be used as Rejection type #1448

Open
jplatte opened this issue Oct 5, 2022 · 0 comments
Open

ErrorResponse can't be used as Rejection type #1448

jplatte opened this issue Oct 5, 2022 · 0 comments
Labels
A-axum-core C-bug Category: This is a bug. P-low Low priority S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work.

Comments

@jplatte
Copy link
Member

jplatte commented Oct 5, 2022

Because ErrorResponse doesn't implement IntoResponse (it can't, instead Result<impl IntoResponse, ErrorResponse does), it can't be used as type Rejection of a FromRequest(Parts) implementation. I think we could fix this by removing the IntoResponse bound on type Rejection in the trait implementation and instead adding where Result<Self, Self::Rejection>: IntoResponse to the trait definition, but I'm also pretty sure that that bound then won't be implied by T: FromRequest and you'll have to drag it along everywhere you want to be generic over FromRequest.

Just wanted this documented, and might try it out again / find the relevant rustc issue.

@jplatte jplatte added C-bug Category: This is a bug. P-low Low priority S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work. A-axum-core labels Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum-core C-bug Category: This is a bug. P-low Low priority S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work.
Projects
None yet
Development

No branches or pull requests

1 participant