Replies: 1 comment
-
|
I think I would personally prefer an opt-in behavior such as an Incidentally, I also would love some kind of "pass-through" option like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(Migrated from remix-run/remix#9477)
In the
react-router-expressadapter, there's acatchthat forwards errors to the next middleware in the stack:react-router/packages/react-router-express/server.ts
Lines 67 to 71 in a11a013
This is good, because I can register an error handler in my Express app to display a branded "server error" page.
However,
returnLastResortErrorResponsemeans that errors in the request handler aren't thrown, so thatcatchisn't triggered and the Express error handler isn't called.react-router/packages/react-router/lib/server-runtime/server.ts
Lines 741 to 755 in a11a013
I think it would be nice if the
react-router-expressdisabledreturnLastResortErrorResponse, causing the error to be thrown from the request handler and passed on to Express instead. The default Express error handler does pretty much exactly the same thing asreturnLastResortErrorResponseanyway, so even in apps without a custom error handler this would be a reasonable behaviour (i.e. it would not have to be configurable externally).Beta Was this translation helpful? Give feedback.
All reactions