-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow falling back to default error handler from custom error handler #2621
Conversation
590d3c7
to
6934959
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might prefer to have an explicit:
const { defaultErrorHandler } = require('fastify')
So that developers can reuse our default implementation wherever they want.
6934959
to
3d51020
Compare
Can you add docs? |
1a567dc
to
0a03cef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When custom
errorHandler
is specified in route config, it is responsible for handling all errors. But what if the custom error handler is interested in only some errors and wants to let fastify handle all other errors using it's default error handler.This PR adds this feature.
Checklist
npm run test
andnpm run benchmark
and the Code of conduct