This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10622 - ECMAScript binding for exceptions
Summary: ECMAScript binding for exceptions
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2010-09-13 07:46 UTC by Anne
Modified: 2011-04-12 02:59 UTC (History)
2 users (show)

See Also:


Description Anne 2010-09-13 07:46:16 UTC
They should inherit from Error. Furthermore, there should be a way for me to declare what the Error name exception field would return, ideally via a shorthand.

For DOMException the name exception field has to return the constant the code exception field returns, as a string. So e.g. for a NAMESPACE_ERR the name exception field would return "NAMESPACE_ERR".
Comment 1 Cameron McCormack 2010-10-28 05:06:23 UTC
Shouldn't the name field be DOMException, and the message have something mentioning NAMESPACE_ERR?  That would be more consistent with native errors.
Comment 2 Anne 2010-10-28 09:19:54 UTC
Oh, if that is more consistent, yes.
Comment 3 Cameron McCormack 2011-04-12 02:59:41 UTC
Exceptions now do inherit from Error, and the value of the name property is defined to be the same as the identifier of the exception.