Allow application to provide express error middleware #13003
Closed
vineetdigit
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using React router 7 in framework mode.
Route loader and action functions are expected to throw route errors by wrapping them with data().
Many of these errors simply originate from external api called from loader or action function, and simply need to be translated to data() for error boundaries to consume them.
I'd prefer not having to try/catch api errors in every loader/action, and instead prefer one single place to do this.
There are multiple ways to do this including writing a higher order functions, but ideally I prefer writing a custom express error handler.
What it seems to me that RR7 doesn't really call next(error) internally for the request to continue and reach my custom middleware.
I'd like to start a conversation on supporting this.
Beta Was this translation helpful? Give feedback.
All reactions