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

Re: [WebIDL] Exceptions

From: Robin Berjon <robin@berjon.com>
Date: Fri, 8 Jul 2011 12:29:44 +0200
Cc: Jonas Sicking <jonas@sicking.cc>, Aryeh Gregor <Simetrical+w3c@gmail.com>, Anne van Kesteren <annevk@opera.com>, WebApps WG <public-webapps@w3.org>
Message-Id: <1E1BC53B-029F-4E5A-934C-AECCC1B194F2@berjon.com>
To: Ian Hickson <ian@hixie.ch>
On Jul 7, 2011, at 21:47 , Ian Hickson wrote:
> 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.

Obviously we should coordinate, but coordination is time-consuming. We shouldn't set ourselves up in such a way that we need to coordinate over every last detail  some things should be such that they just work, without requiring WebApps, HTML, DAP, Web Notifications, CSS, Web Performance, WHAT, MAWG, RDF WebApps, SVG, Geolocation, and several I'm forgetting about to all talk together.

Having to coordinate over whether your exception code should be 17 or 42 is a waste of time, time best spent on coordinating over issues that actually matter. It's also too easy to overlook. We've shot ourselves in the feet repeatedly with this one, a change wouldn't hurt.

>> 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.)

Yeah, it's completely lost in JS, if you typo either of the above variants they both fail silently.

Robin Berjon - http://berjon.com/ - @robinberjon
Received on Friday, 8 July 2011 10:30:09 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:33 UTC