Feature: Support `cause` property on errors
See original GitHub issueDo you want to request a feature or report a bug?
feature
What is the current behavior?
try {
somethingThatThrows();
} catch (innerError) {
let error = new Error('something failed!');
error.cause = innerError;
throw error;
}
With the current behavior only the outer/wrapping Error
is shown in the stack trace.
What is the desired behavior?
It would be great if the inner Error
was also displayed in the stacktrace view, roughly similar to how it is done for Java and Python.
I’m happy to help implement this with a bit of guidance 😃
- does the serverside need changes or does it already support this due to support in Java?
- what changes to the submitted payload are necessary?
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (16 by maintainers)
Top Results From Across the Web
Error.prototype.cause - JavaScript - MDN Web Docs - Mozilla
The cause data property of an Error instance indicates the specific original cause of the error.
Read more >Error causes - V8 JavaScript engine
JavaScript now supports error causes. An additional options parameter can be added to the Error constructor with a cause property, the value ...
Read more >A Definitive Guide to Handling Errors in JavaScript - Kinsta
Errors in JavaScript carry certain standard and custom properties that help understand the cause and effects of the error.
Read more >Custom errors, extending Error - The Modern JavaScript Tutorial
Our errors should support basic error properties like message , name and, preferably, stack . But they also may have other properties of ......
Read more >javascript - Error cause property not recognized in TypeScript
TypeScript also includes APIs for newer JS features matching the ... However, support for the Error.cause property was added to Node in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nevermind, I just found https://github.com/getsentry/sentry-javascript/blob/4.2.3/packages/browser/src/integrations/linkederrors.ts 🎉
@Turbo87 like this? 😃