Skip to content
Discussion options

You must be logged in to vote

Doing it as side-effects in the IntoResponse implementation is currently the easiest solution.

Another option people sometimes do is adding additional information (like the error itself) into response extensions and then checking the extensions in a middleware.

Personally, I would advise against the map_err in handlers way because remembering to do that at every single place including all short-circuiting ? would be almost impossible for any mid-sized project. Or maybe I'm just a pessimist.


What would you say is the ideal scenario? How would you want it to work if anything was technically possible? This is an area that I think could be improved and it would be great to have opinions from…

Replies: 2 comments 1 reply

Comment options

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

You must be logged in to vote
1 reply
@mladedav
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
2 participants