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

Support chained Errors #362

@jstewmon

Description

@jstewmon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions