question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It doesn't show original stack trace for linked errors

See original GitHub issue

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? @sentry/react-native 3.2.13

Steps to Reproduce

I need to report inner error when throwing exceptions, and LinkedErrors is the solution I found. To link two error, I assigned the inner error to the cause property of the final error.

//....
finalError.cause = innerError
Sentry.captureException(finalError)

When I tested, both the higher level error and the inner error are logged to sentry, however the stack trace was minified. But if I don’t link them, the stack trace worked fine, so I think it’s a bug. Here is a mini repo to reproduce the issue. https://github.com/Yupeng-li/sentry-test

The repo is a react-native app with two simple buttons: one throws an error and another throws an error with cause property.

Please modify the DSN before running it.

Expected Result

Linked error should have original stack trace.

This is what I got when I reported the error directly. (Throw an error) image

Actual Result

This is what I got when I reported the error with cause. (Throw an error with cause) linked errors

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
AbhiPrasadcommented, Mar 7, 2022

This is strange, it seems that RewriteFrames doesn’t update the stacktrace here?

https://github.com/getsentry/sentry-react-native/blob/16cfa52fcae796c51d1880b2ad6d9fc73dbede59/src/js/sdk.tsx#L72

Not sure if it’s a general SDK bug, or just based on how react native sdk is configuring RewriteFrames, we need to test with a stock browser SDK app that uses LinkedErrors + RewriteFrames.

1reaction
liamjonescommented, Dec 7, 2022

@krystofwoldrich I believe it’s only working for release mode, it’s still broken in debug builds, isn’t it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get a JavaScript stack trace when I throw an ...
A better (and simpler) solution as pointed out in the comments on the original question is to use the stack property of an...
Read more >
Error - JavaScript - MDN Web Docs - Mozilla
This ensures that the original error and stack trace are available to higher-level try/catch blocks. The example below shows this for two ...
Read more >
Enable Readable Stack Traces in Your Errors
Learn more about enabling readable stack traces in your errors. ... Sentry will use the release's uploaded source maps to unminify the error's...
Read more >
Understanding the Python Traceback
Tracebacks are known by many names, including stack trace, stack ... This code doesn't have any bugs that would result in an exception...
Read more >
Stack Trace: How to Debug Your Application With a Stack Trace
This also implies that a stack trace is printed top-down. The stack trace first prints the function call that caused the error and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found