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.

Feature: Support `cause` property on errors

See original GitHub issue

Do 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:closed
  • Created 5 years ago
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilogorekcommented, Sep 5, 2018

@Turbo87 like this? 😃

screen shot 2018-09-05 at 11 15 20

Read more comments on GitHub >

github_iconTop 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 >

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