You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
diagnostics channel for fastify v5 introduced a breaking change by removing custom shouldHandleError support #16819
Prior to the release of the change in 9.33.0 it was required to explicitly initialize sentry. It was also possible to provide a custom shouldHandleError function - ref.
Starting with 9.33.0 there is no need to call setupFastifyErrorHandler when using fastify v5, in fact calling setupFastifyErrorHandler has no effect as stated by the logs emitted by the sentry sdk
Fastify error handler was already registered via diagnostics channel.
You can safely remove `setupFastifyErrorHandler` call.
I think there is currently no way to pass a custom shouldHandleError while using sentry >= 9.33.0 and fastify v5. As a workaround we have downgraded to sentry-sdk 9.32.0 for now.
Thanks!
Expected Result
no errors should be reported by sentry (if thrown inside a fastify handler)
Actual Result
since the provided implementation of shouldHandleError is no longer used it has no effect and all errors that are not filtered by the defaultShouldHandleError are reported anyways
ah, that makes sense of course. Sorry about that, we need to see how we can handle this better, probably passing the handler should overwrite the default handler. cc @onurtemizkan could you take a look at that?
Hey @tobiasdcl I just merged in the initial PR. Since we're working on the next major version, I still need to merge the "backport" for v9 and get that released. Should be out by tomorrow.
Activity
mydea commentedon Jul 7, 2025
ah, that makes sense of course. Sorry about that, we need to see how we can handle this better, probably passing the handler should overwrite the default handler. cc @onurtemizkan could you take a look at that?
tobiasdcl commentedon Jul 22, 2025
Hi @mydea,
I saw that the PR is ready for a while now. Could we get this over the finish line? 🚀
feat(node): Add `shouldHandleError` option to `fastifyIntegration` (#…
feat(node): Add `shouldHandleError` option to `fastifyIntegration` (#…
Lms24 commentedon Jul 22, 2025
Hey @tobiasdcl I just merged in the initial PR. Since we're working on the next major version, I still need to merge the "backport" for v9 and get that released. Should be out by tomorrow.
tobiasdcl commentedon Jul 22, 2025
Awesome, thanks!
AbhiPrasad commentedon Jul 24, 2025
released with https://github.com/getsentry/sentry-javascript/releases/tag/9.41.0
github-actions commentedon Jul 31, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #16845, which was included in the 10.0.0 release.