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

Re: [WebIDL] Exceptions

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 7 Jul 2011 19:47:07 +0000 (UTC)
To: Jonas Sicking <jonas@sicking.cc>
cc: Aryeh Gregor <Simetrical+w3c@gmail.com>, Anne van Kesteren <annevk@opera.com>, WebApps WG <public-webapps@w3.org>
Message-ID: <Pine.LNX.4.64.1107071942330.20871@ps20323.dreamhostps.com>
On Thu, 7 Jul 2011, Jonas Sicking wrote:
> 
> It's a pain since it forces us to try to coordinate codes across
> multiple specifications, working groups and standards organizations.

Anything that allows us to _not_ coordinate is an epic disaster, IMHO.

We absolutely should be coordinating. How else can we ensure the platform 
is a consistent platform?

This is a feature, not a bug.


> And even if this coordinating somehow started magically working, it 
> still means that exceptions thrown by the DOM needs to be checked 
> differently than exceptions thrown by ES. So you'll end up having to do:

Are there exceptions that can be legitimately thrown by JS that aren't 
programming bugs?


> Lastly, the syntax:
> if (ex.name === "HierarchyRequestError") { ... }
> is a lot easier on the eyes than:
> if (ex.code === DOMException.HIERARCHY_REQUEST_ERR) { ... }
> IMHO.

I've no problem with adding names to all the current exceptions, if we 
want to do that. (I generally am averse to using strings for values, since 
they don't syntax check well, but in JS that game is somewhat lost in the 
above scenario anyway, so whatever.)

My concern is with having newer parts of the platform use entirely 
different models (e.g. new exception interfaces) relative to older parts 
of the platform (which e.g. use codes). It leads to the kind of problem 
you describe with JS vs DOM, except that we'd have JS vs DOM vs new DOM vs 
even new DOM, etc.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 7 July 2011 19:47:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:46 GMT