Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(node-core): Extend onnhandledrejection with ignore errors option #17736

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

Draft
RulaKhaled wants to merge 4 commits into develop
base: develop
Choose a base branch
Loading
from fix-bug

Conversation

Copy link
Member

@RulaKhaled RulaKhaled commented Sep 22, 2025

I’m introducing support for selectively suppressing specific errors. This is done by adding a new option that allows users to override the default logging modes. By passing this option down through the configuration, users will have finer control over which errors are logged versus ignored. Also added a default array for the errors, addressing an issue where Vercel’s flush is called during abort, causing unnecessary error logs.

Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.26 kB - -
@sentry/browser - with treeshaking flags 22.77 kB - -
@sentry/browser (incl. Tracing) 40.4 kB - -
@sentry/browser (incl. Tracing, Replay) 78.78 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.44 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.44 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.66 kB - -
@sentry/browser (incl. Feedback) 40.97 kB - -
@sentry/browser (incl. sendFeedback) 28.91 kB - -
@sentry/browser (incl. FeedbackAsync) 33.84 kB - -
@sentry/react 25.98 kB - -
@sentry/react (incl. Tracing) 42.38 kB - -
@sentry/vue 28.78 kB - -
@sentry/vue (incl. Tracing) 42.21 kB - -
@sentry/svelte 24.29 kB - -
CDN Bundle 25.77 kB - -
CDN Bundle (incl. Tracing) 40.24 kB - -
CDN Bundle (incl. Tracing, Replay) 76.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.96 kB - -
CDN Bundle - uncompressed 75.37 kB - -
CDN Bundle (incl. Tracing) - uncompressed 119.13 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 234.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 247.02 kB - -
@sentry/nextjs (client) 44.4 kB - -
@sentry/sveltekit (client) 40.82 kB - -
@sentry/node-core 50.21 kB +0.39% +192 B 🔺
@sentry/node 152.44 kB +0.13% +192 B 🔺
@sentry/node - without tracing 92.14 kB +0.22% +196 B 🔺
@sentry/aws-serverless 105.59 kB +0.19% +199 B 🔺

View base workflow run

Copy link
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,205 - 9,167 +0%
GET With Sentry 1,370 15% 1,334 +3%
GET With Sentry (error only) 5,965 65% 6,001 -1%
POST Baseline 1,205 - 1,172 +3%
POST With Sentry 510 42% 491 +4%
POST With Sentry (error only) 1,041 86% 1,032 +1%
MYSQL Baseline 3,255 - 3,310 -2%
MYSQL With Sentry 476 15% 372 +28%
MYSQL With Sentry (error only) 2,667 82% 2,636 +1%

View base workflow run

}

/** Check if a matcher matches the reason */
function checkMatcher(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L: I would rename this function to something like isMatchingReason to make the name more descriptive. Typically, functions that return a boolean start with something like is or has.

RulaKhaled reacted with thumbs up emoji

const DEFAULT_IGNORES: IgnoreMatcher[] = [
{
name: 'AI_NoOutputGeneratedError', // When stream aborts in Vercel AI SDK, flush() fails with an error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What flush() are we talking about? Our Sentry.flush() call or some method within the vercel AI package?

Copy link

@raymondhechen raymondhechen Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lms24 likely referencing flush() in vercel AI package. This PR stems from this issue I put up: #17675

RulaKhaled reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@Lms24 Lms24 Lms24 left review comments

@s1gr1d s1gr1d s1gr1d left review comments

+1 more reviewer

@raymondhechen raymondhechen raymondhechen left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /