Bug 117773 - DOMException toString can serialize more useful information
Summary: DOMException toString can serialize more useful information
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2013-06-18 20:15 PDT by Ryosuke Niwa
Modified: 2017-01-18 23:38 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-06-18 20:15:42 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/4010ed524b9d6348a76567b55fbe1a756a6f35ef

DOMException toString is not correct

We used to print:

    "Error: HIERARCHY_REQUEST_ERR: DOM Exception 3"

Now we print a more useful message:

    "HierarchyRequestError: The operation would yield an incorrect node tree."

that is:

    `${error.name}: ${error.message}`
Comment 1 Alexey Proskuryakov 2013-06-19 10:08:57 PDT
So, Chromium no longer prints the exception code, yet it prints arbitrary text from exception description that may or may not be relevant to the actual reason this particular exception was raised for? I don't think that it's an improvement overall.
Comment 2 Timothy Hatcher 2013-06-19 11:27:00 PDT
I think some description is nice. I've had to search for DOM exception codes one to many times. I agree the exception code should still be in there.
Comment 3 Erik Arvidsson 2013-06-19 11:35:31 PDT
The exception code is deprecated. Use the name property instead. Most new exceptions have the code set to 0.

AP: The error messages could definitely use some improvements. The long term goal was to allow the error message to be more specific based on were it was being set/thrown.