-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error overlay: show cause
if available
#6052
Conversation
🦋 Changeset detectedLatest commit: 4d867c5 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
this.text('#cause-content', err.cause); | ||
cause.style.display = 'block'; | ||
} else { | ||
this.text('#cause-content', JSON.stringify(err.cause, null, 2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally wanted to check if this is instanceof Error
and display it, but for some reason err.cause
is missing info and just returns an empty object when i do this:
try {
console.log(something.that.doesnt.exist);
} catch (err) {
throw new Error('oh no!', { cause: err });
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff, thank you very much!
* show `cause` in error overlay * add extra check for string * add changeset
Changes
Added ability to display an error's
cause
if available. Closes #6027Testing
Tested in a local project by changing code inside node modules.
Test fixture currently pending.
Docs
Not needed I think? I guess we could document how to use the
cause
property.