-
-
Notifications
You must be signed in to change notification settings - Fork 131
Support chained Errors #362
Description
Do you want to request a feature or report a bug?
feature
Has someone had this problem before?
This issue was reported for the Java client in getsentry/sentry-java/issues/43 and the server getsentry/sentry/issues/842, but has not been reported for the node client.
What is the current behavior?
- The
exceptionfield of the event is always an array of 1 error. parsers.parserErrordoes not support modifying this behavior.- The Error instance is not passed to
dataCallback, so theexceptionarray cannot be updated with additional exceptions parsed from the Error instance.
What is the expected behavior?
It should be possible to capture chained errors in the exceptions field.
The native Error type does not support exception chaining, but some packages provide support for error chaining. Examples are verror and nested-error-stacks.
I wouldn't necessarily expect the raven package to directly handle chained errors, since they are not part of the standard library and there is no common interface, but I see a couple of options for how this could be supported:
- Support a
errorCallbackconfig option. The callback would take theErroras its parameter and returns either anErrororError[]. All returned errors are parsed and added to theexceptionarray. - Make the captured Error available to
dataCallback, so that it can modify theexceptionarray on the event.