Skip to content

linkedErrors limit is not applied to AggregateError / SuppressedError children #25836

Open

Description

@CheckPickerUpper

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

11.9.0 (also checked current develop)

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

const Sentry = require('@sentry/node');

Sentry.init({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
  // default linkedErrorsIntegration limit is 5
});

const children = Array.from({ length: 20 }, (_, i) => new Error(`child-${i}`));
Sentry.captureException(new AggregateError(children, 'group'));

Steps to Reproduce

  1. Capture an AggregateError whose errors array is longer than the linked-errors limit (default 5).
  2. 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

  1. linear-code commented on Oct 28, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions