W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2011

[Bug 10623] Simplify Web IDL exceptions

From: <bugzilla@jessica.w3.org>
Date: Fri, 09 Sep 2011 12:30:49 +0000
To: public-script-coord@w3.org
Message-Id: <E1R20EL-0005hg-2X@jessica.w3.org>

--- Comment #14 from Cameron McCormack <cam@mcc.id.au> 2011-09-09 12:30:43 UTC ---
I've had another crack at exceptions.  There is no recommendation in the spec
now to create a hierarchy of exceptions.  Instead it recommends to use
DOMException for all new exception types, or to mint a new IDL exception only
if new exception fields are required.  IDL exceptions now conceptually have a
"type", which gets mapped on to the .name property in JS.  So you could say

  Throw a DOMException of type "FooBarError".

and that would result in a DOMException object whose .name == "FooBarError". 
You can not specify the type, in which case .name == "DOMException" (so the
name of the constructor is the .name of the exception, like the builtin JS

There's no IDL syntax for defining exception types like "FooBarError" above;
just do this in prose.

Jonas, Alex and I had some offlist discussions about whether we could do away
with DOMException altogether and just use Error.  I think some experiments were
going to be done to see if this is feasible.  I am happy for now using

Comments welcome.  Perhaps start a thread on public-script-coord if there are
issues with this approach.  I will declare this Last Call comment resolved at
this point, however.  Anne, please indicate whether this resolution is

See the exact change here:


Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Friday, 9 September 2011 12:30:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:04 UTC