Can we take inspiration from how Pavex handles errors? #2587
Labels
A-axum-core
C-musings
Category: musings about a better world
E-hard
Call for participation: Experience needed to fix: Hard / a lot
Feature Request
Motivation
There is a great recent blogpost from Luca Palmieri which outlines some DX issues with how Axum and Actix are handling errors. I understand that having a link instead of the description isn't great in an issue, but doubt I could summarize the idea better than the blogpost does. Though it's quite short anyways.
And in the end of the article he describe a little bit different approach on how he designed error handling for Pavex. To me it seems like a similar API could be implemented for Axum and work great.
Proposal
The overall idea in short is to skip implementing
IntoResponse
forResult
and instead provide.error_handler
method to register error handlers, where in the userspace various logic could be handled.Does it seem doable for Axum and do you think it make sense? If you are open to the idea than do you think implementing this in Axum would be doable for a first time contributor? Perhaps with some guidance. I overall love the framework and am interested to at least try to get my hands dirty with this.
Alternatives
There are workarounds presented in the blogpost and why Luca thinks they are not ideal.
The text was updated successfully, but these errors were encountered: