-
Notifications
You must be signed in to change notification settings - Fork 23.1k
Closed
Labels
Content:JSJavaScript docsJavaScript docs
Description
MDN URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
What specific section or headline is this issue about?
Properties > error.prototype.cause
What information was incorrect, unhelpful, or incomplete?
Error cause. If an error is caught and re-thrown, this property should contain the original error.
This makes me think along the lines of literally
try {
...
try {
...
} catch (exception) {
// throw it again
throw exception;
}
} catch (exception) {
// it has a .cause now!
const { cause } = exception;
}which isn't accurate at all.
On another note, it says Error.prototype.cause, but this is actually an OwnProperty.
See, https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-installerrorcause.
I don't think that any articles properly make this distinction, nor that there may be infrastructure or precedent for doing so.
What did you expect to see?
The cause is supplied by the code that throws the error object, this should be clarified.
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/web/javascript/reference/global_objects/error - MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/javascript/reference/global_objects/error/index.md
- Last commit: 036687e
- Document last modified: 2022-06-23T14:58:53.000Z
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Content:JSJavaScript docsJavaScript docs