-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
anyhow-based error handling example should be advertised more broadly #2046
Comments
Like described in the error handling docs axum does not consider a handler returning With that said I think it's fine to link to the anyhow example from the docs. Do you want to submit a PR for that? |
Do I understand that there can be two meanings of the word "fallible" in this context:
Maybe, but I want to ensure I understand it properly myself first. |
I don't think we should document returning I think we should just link to the anyhow example. |
Fixed in #2049 |
Feature Request
Motivation
Primary place where I end up when looking how to make fallible handlers is
axum::error_handling
module documentation page. It even contains mentions of "anyhow" in "Routing to fallible services" section, but it is not clear how just upgrade existing infallible handlers to anyhow-fallible ones.Fortunately, there is already an example of how to wrap Anyhow errors for Axum consumption (even with a properly working
?
operator), but it is not obvious how to get there.Proposal
Include a link to anyhow-error-response in
axum::error_handling
module documentation, e.g. in "axum’s error handling model" section.Alternatives
AppError
directly in the docs (instead of a link).The text was updated successfully, but these errors were encountered: