Skip to content
Discussion options

You must be logged in to vote

Technically it is possible but I think it would be a footgun and leads to many questions. How should it be turned into a response? As text, json, xml, yaml? What should the formatting be like? anyhow::Errors are also likely to contain private details about the application that you don't want to expose to clients.

Therefore we recommend you make a wrapper like shown here https://github.com/tokio-rs/axum/blob/main/examples/anyhow-error-response/src/main.rs

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by fdietze
Comment options

You must be logged in to vote
1 reply
@davidpdrsn
Comment options

Comment options

You must be logged in to vote
6 replies
@edezhic
Comment options

@davidpdrsn
Comment options

@edezhic
Comment options

@davidpdrsn
Comment options

@edezhic
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants