René's URL Explorer Experiment


Title: fix(server-utils): Skip Fastify 4xx errors raised before the reply status is set by tobias-schnabel · Pull Request #24924 · getsentry/sentry-javascript · GitHub

Open Graph Title: fix(server-utils): Skip Fastify 4xx errors raised before the reply status is set by tobias-schnabel · Pull Request #24924 · getsentry/sentry-javascript

X Title: fix(server-utils): Skip Fastify 4xx errors raised before the reply status is set by tobias-schnabel · Pull Request #24924 · getsentry/sentry-javascript

Description: Since v11, fastifyIntegration always registers an onError hook (#23460). Fastify runs onError hooks before it applies the error's status to the reply, so for errors raised outside the route handler, such as a request body that fails to parse (FST_ERR_CTP_EMPTY_JSON_BODY, FST_ERR_CTP_INVALID_JSON_BODY), defaultShouldHandleError still reads reply.statusCode === 200 and captures what is sent to the client as a 400. #18418 fixed the same symptom for route handler errors upstream in Fastify 5.7.0, but only on the diagnostics channel path. When reply.statusCode is still the default 200, the default shouldHandleError now resolves the status the same way Fastify's setErrorStatusCode does: the error's statusCode or status if it is at least 400, otherwise 500. This predicts the status Fastify is about to send, and errors without a status still count as 500, so they are still captured. A status already set on the reply takes precedence, as before. A custom shouldHandleError still receives reply.statusCode === 200 on this path. I left that alone, since changing what callbacks receive is a separate decision. Fixes #24926

Open Graph Description: Since v11, fastifyIntegration always registers an onError hook (#23460). Fastify runs onError hooks before it applies the error's status to the reply, so for errors raised outside the route han...

X Description: Since v11, fastifyIntegration always registers an onError hook (#23460). Fastify runs onError hooks before it applies the error's status to the reply, so for errors raised outside the route...

Opengraph URL: https://github.com/getsentry/sentry-javascript/pull/24924

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e92d3859-4775-95cc-789c-3c28a06371cd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE8C0:51CB6:19CDFD5:2237A76:6B042349
html-safe-nonce768221ef214a318b304832eb4f0225f9df3bb497e848e2a3dec154a00cf71738
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEMwOjUxQ0I2OjE5Q0RGRDU6MjIzN0E3Njo2QjA0MjM0OSIsInZpc2l0b3JfaWQiOiI3OTEzOTU0OTA1MTY4MjkwNjMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac32f88f4b1d3fd1acbe84d9ad4c0cfde8d887fbe4905b42a8a76cbe00b17fc928
hovercard-subject-tagpull_request:4701786048
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/getsentry/sentry-javascript/pull/24924/files
twitter:imagehttps://avatars.githubusercontent.com/u/70516553?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/70516553?s=400&v=4
og:image:altSince v11, fastifyIntegration always registers an onError hook (#23460). Fastify runs onError hooks before it applies the error's status to the reply, so for errors raised outside the route han...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef8d9f404447ab5df341c8a92cf5fc927730ad1321e64ac57656444d2438097f1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef7edccce04851591ee529948701779ce6819bc53
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/pull/24924/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fpull%2F24924%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fpull%2F24924%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/pull/24924/files
Reloadhttps://github.com/getsentry/sentry-javascript/pull/24924/files
Reloadhttps://github.com/getsentry/sentry-javascript/pull/24924/files
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues339 (339)https://github.com/getsentry/sentry-javascript/issues
Pull requests59 (59)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgetsentry%2Fsentry-javascript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgetsentry%2Fsentry-javascript%2Fissues%2Fnew%2Fchoose
nicohrubechttps://github.com/nicohrubec
getsentry:develophttps://github.com/getsentry/sentry-javascript/tree/develop
tobias-schnabel:fix/fastify-default-error-statushttps://github.com/tobias-schnabel/sentry-javascript/tree/fix/fastify-default-error-status
Conversation 8 https://github.com/getsentry/sentry-javascript/pull/24924
Commits 3 https://github.com/getsentry/sentry-javascript/pull/24924/commits
Checks 0 https://github.com/getsentry/sentry-javascript/pull/24924/checks
Files changed https://github.com/getsentry/sentry-javascript/pull/24924/files
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/24924/files
fix(server-utils): Skip Fastify 4xx errors raised before the reply status is set https://github.com/getsentry/sentry-javascript/pull/24924/files#top
Show all changes 3 commits https://github.com/getsentry/sentry-javascript/pull/24924/files
c5f4af1 fix(server-utils): Skip Fastify 4xx errors raised before the reply st… tobias-schnabel Oct 1, 2026 https://github.com/getsentry/sentry-javascript/pull/24924/commits/c5f4af16317e44dac99612bd53879ed5520db882
084d815 fix(server-utils): Guard the Fastify error status lookup against non-… tobias-schnabel Oct 2, 2026 https://github.com/getsentry/sentry-javascript/pull/24924/commits/084d8152fb6283aac9e63965b8dcc501eb74c66d
d7e2622 test(node): Flush before the follow-up error in the Fastify 4xx test tobias-schnabel Oct 2, 2026 https://github.com/getsentry/sentry-javascript/pull/24924/commits/d7e26228669bf4acf29a94180c69ae34c4bb02ef
Clear filters https://github.com/getsentry/sentry-javascript/pull/24924/files
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/24924/files
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/24924/files
scenario.mjs https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-20a4771ce4dc58255e25b395dae67733e5db85ee17ba64db821dc40a4846a037
test.ts https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-369e424a3c3e48162da26d0b7b58439bdf204fe017e9c39fa54fd789d792f082
utils.ts https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-ed493768819c147da8152cfecd0bc9262ff99530d997e5067c11e7a1d9c8cce6
utils.test.ts https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-fb644e4af5eef250743eca5dab1dce0160c8931c55fcd477278a09df136ffc39
dev-packages/node-integration-tests/suites/tracing/fastify/scenario.mjshttps://github.com/getsentry/sentry-javascript/pull/24924/files#diff-20a4771ce4dc58255e25b395dae67733e5db85ee17ba64db821dc40a4846a037
View file https://github.com/tobias-schnabel/sentry-javascript/blob/d7e26228669bf4acf29a94180c69ae34c4bb02ef/dev-packages/node-integration-tests/suites/tracing/fastify/scenario.mjs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/24924/{{ revealButtonHref }}
https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-20a4771ce4dc58255e25b395dae67733e5db85ee17ba64db821dc40a4846a037
https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-20a4771ce4dc58255e25b395dae67733e5db85ee17ba64db821dc40a4846a037
dev-packages/node-integration-tests/suites/tracing/fastify/test.tshttps://github.com/getsentry/sentry-javascript/pull/24924/files#diff-369e424a3c3e48162da26d0b7b58439bdf204fe017e9c39fa54fd789d792f082
View file https://github.com/tobias-schnabel/sentry-javascript/blob/d7e26228669bf4acf29a94180c69ae34c4bb02ef/dev-packages/node-integration-tests/suites/tracing/fastify/test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/24924/{{ revealButtonHref }}
https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-369e424a3c3e48162da26d0b7b58439bdf204fe017e9c39fa54fd789d792f082
nicohrubechttps://github.com/nicohrubec
Oct 2, 2026https://github.com/getsentry/sentry-javascript/pull/24924/files#r4164826883
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/24924/files
tobias-schnabelhttps://github.com/tobias-schnabel
Oct 2, 2026https://github.com/getsentry/sentry-javascript/pull/24924/files#r4164915822
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
d7e2622https://github.com/getsentry/sentry-javascript/commit/d7e26228669bf4acf29a94180c69ae34c4bb02ef
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/24924/files
packages/server-utils/src/integrations/fastify/utils.tshttps://github.com/getsentry/sentry-javascript/pull/24924/files#diff-ed493768819c147da8152cfecd0bc9262ff99530d997e5067c11e7a1d9c8cce6
View file https://github.com/tobias-schnabel/sentry-javascript/blob/d7e26228669bf4acf29a94180c69ae34c4bb02ef/packages/server-utils/src/integrations/fastify/utils.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/24924/{{ revealButtonHref }}
https://github.com/getsentry/sentry-javascript/pull/24924/files#diff-ed493768819c147da8152cfecd0bc9262ff99530d997e5067c11e7a1d9c8cce6
packages/server-utils/test/integrations/fastify/utils.test.tshttps://github.com/getsentry/sentry-javascript/pull/24924/files#diff-fb644e4af5eef250743eca5dab1dce0160c8931c55fcd477278a09df136ffc39
View file https://github.com/tobias-schnabel/sentry-javascript/blob/d7e26228669bf4acf29a94180c69ae34c4bb02ef/packages/server-utils/test/integrations/fastify/utils.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/24924/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.