Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Support chained Errors #362

Open
jstewmon opened this issue Aug 16, 2017 · 1 comment
Open

Support chained Errors #362

jstewmon opened this issue Aug 16, 2017 · 1 comment

Comments

@jstewmon
Copy link

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 exception field of the event is always an array of 1 error.
  • parsers.parserError does not support modifying this behavior.
  • The Error instance is not passed to dataCallback, so the exception array 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 errorCallback config option. The callback would take the Error as its parameter and returns either an Error or Error[]. All returned errors are parsed and added to the exception array.
  • Make the captured Error available to dataCallback, so that it can modify the exception array on the event.
@jstewmon
Copy link
Author

@kamilogorek any thoughts on this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant