designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

Support aggregated errors (aka. AggregateError)

Open mortargrind opened this issue 2 months ago • 1 comments

JavaScript has AggregateError (see); which is a type of an error that can hold many different sibling errors at the same time. It's similar to Error.cause property but Aggregated error can have many "cause"s at the same time, not sequentially linked to on another but all parallel to each other.

Many languages have a similar concept, under slightly different names like ExceptionGroup in Python or AggregateException in C#.

Currently, when you report AggregateError, you do not see anything regarding the underlying errors. Which forces us to report errors in a loop individually.

While this is better than nothing, it'd be great to have the aggregated error support so you can have a single error report with a high-level error type (is an AggregateError or extending from AggregateError) and/or with a specific error message so you can do things like counting the instance of failures, not number of underlying errors etc.

This is similar to supporting linked errors via cause property, but slightly different as it's not a "vertical" connection but instead a "horizontal" one.

Linking Sentry issue (https://github.com/getsentry/rfcs/blob/main/text/0079-exception-groups.md) here because I believe almost everything in that issue description & comments is true for DataDog too.

As mentioned in that ticket, this probably requires changes in the product & its UI too, not just in the SDK. I am openning the issue here anyways for visibility for other people who might need the same feature.

mortargrind avatar Dec 05 '25 09:12 mortargrind

Hi @mortargrind, thanks for reporting this, that would indeed be a nice addition!

this probably requires changes in the product & its UI too

You are right, we'll track that internally and will notify here when we will make progress on it.

bcaudan avatar Dec 08 '25 09:12 bcaudan