sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

`cause` of an error not being reported/rendered when it's structured data

Open tleunen opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [x] I have reviewed the documentation https://docs.sentry.io/
  • [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.25.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

I've seen cause being reported in the past when they were of type "error", but when they are simply structured data, it doesn't seem to be reported anywhere. Although according to MDN, this should be allowed https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause#providing_structured_data_as_the_error_cause

Steps to Reproduce

  1. Throw an error with a cause as structured data, such as
throw new Error('Custom error with structured cause', {
        cause: {
          booleanValue: true
          text: 'message',
          array: [1, 2, 3]
        },
      })
  1. Notice the cause never shows up in the web interface for the reported error

Expected Result

The cause should show up

Actual Result

The cause doesn't show up in the reported error, so it removes ability to properly debug things.

tleunen avatar Aug 13 '24 15:08 tleunen

Hi, we'll backlog this. Thanks for reporting!

lforst avatar Aug 13 '24 16:08 lforst

Related https://github.com/getsentry/sentry-javascript/issues/7051

lforst avatar Aug 14 '24 13:08 lforst

Can be closed as this was fixed here: https://github.com/getsentry/sentry-javascript/pull/9914

s1gr1d avatar Jan 15 '25 11:01 s1gr1d