docs: add a warning about setErrorHandler overriding a previously defined error handler on an encapsulated context#6097
Conversation
…ilently override the previous handler
|
I am gonna try to offer a fix rather than just documentation, as a lot of people don't read it or forget. |
setErrorHandler should not silently overrides previously defined handler on an encapsulated context
setErrorHandler should not silently overrides previously defined handler on an encapsulated contextsetErrorHandler should not silently overrides previously defined handler on an encapsulated context
metcoder95
left a comment
There was a problem hiding this comment.
I'm not convinced of changing the behavior (that will also impose a breaking change), but rather extend documentation about it.
by allowing overrides, we allow to customize different levels of error handler and also enable plugins to do so; this might be better if is extended in the documentation rather than changed in this way.
|
We can make a documentation PR and keep this one for next major (EDIT: did the opposite). |
9dcf3a4 to
367a535
Compare
setErrorHandler should not silently overrides previously defined handler on an encapsulated contextsetErrorHandler overriding a previously defined error handler on an encapsulated context
|
@metcoder95 |
…efined error handler on an encapsulated context (fastify#6097) * docs: calling setErrorHandler more than once in the same scope will silently override the previous handler * fix: lint markdown * docs: nit * docs: apply convention * docs: apply convention
…efined error handler on an encapsulated context (fastify#6097) * docs: calling setErrorHandler more than once in the same scope will silently override the previous handler * fix: lint markdown * docs: nit * docs: apply convention * docs: apply convention
|
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. |
Regarding #6096