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
linkedErrors limit is not applied to AggregateError / SuppressedError children #25836
constSentry=require('@sentry/node');Sentry.init({dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',// default linkedErrorsIntegration limit is 5});constchildren=Array.from({length: 20},(_,i)=>newError(`child-${i}`));Sentry.captureException(newAggregateError(children,'group'));
Steps to Reproduce
Capture an AggregateError whose errors array is longer than the linked-errors limit (default 5).
Inspect event.exception.values (or the event in Sentry).
The same pattern applies to a long SuppressedError chain via the error / suppressed properties.
In packages/core/src/utils/aggregate-errors.ts, the limit check runs at the start of each recursive call, but the AggregateError.errors and SuppressedError loops still walk every child and prepend each one before that check can stop the walk. Cause chains via key (usually cause) do get capped.
I opened #25767 without an issue first and it was closed — filing here as requested before any further PR.
Expected Result
At most limit + 1 exceptions in event.exception.values (the root plus up to limit linked ones), including when the extras come from AggregateError.errors or SuppressedError.
Actual Result
Every AggregateError child (and every SuppressedError sibling) is turned into an exception. With 20 children and the default limit of 5, you get far more than 6 values.
Happy to open a PR once a maintainer confirms this is wanted.
Activity
linear-code commentedon Oct 28, 2026
JS-4032