-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Duplicate errors that are un-writable #9046
Conversation
28c256b
to
09ddee4
Compare
09ddee4
to
a6a5e36
Compare
e[prop] = error[prop]; | ||
} | ||
// Ensure these are copied. | ||
e.stack = error.stack; |
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.
Is this really a thing?
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'm not 100% sure that stack
is an enumerable property in all browsers, so it seemed like a good defense.
Or, are you asking about overriding the stack? In that case, yup, it's a thing. It's used a lot to clean stack traces, avoiding "internal" frames.
9a8f07c
to
f54235a
Compare
Certain errors (`DOMException`s, really) have un-writable error messages. This mucks with our code, since we rewrite it to signal user errors, give context, etc. If an error's message isn't writable, duplicate the error with one that is.
f54235a
to
2de9157
Compare
Do I need to cherry pick this to 1% canary (to be promoted to prod) and opt in canary (to be deployed)? |
Nah. |
Certain errors (
DOMException
s, really) have un-writable errormessages. This mucks with our code, since we rewrite it to signal user
errors, give context, etc.
If an error's message isn't writable, duplicate the error with one that
is.
Fixes #8917.