W3C home > Mailing lists > Public > public-device-apis@w3.org > September 2009

Re: ISSUE-2 (error-handling): Error handling style [APIs General]

From: Robin Berjon <robin@berjon.com>
Date: Tue, 1 Sep 2009 11:36:12 +0200
Cc: "Device APIs and Policy Working Group WG" <public-device-apis@w3.org>
Message-Id: <C5BB0F7D-9C96-4719-AE60-9D2376A51CB7@berjon.com>
To: Arve Bersvendsen <arveb@opera.com>
On Aug 31, 2009, at 21:10 , Arve Bersvendsen wrote:
> On Tue, 25 Aug 2009 15:07:42 +0200, Device APIs and Policy Working  
> Group Issue Tracker <sysbot+tracker@w3.org> wrote:
>> We need to pick a common style for error handling.
>
> Do we? And if we do, hasn't this choice already been made for us by  
> other working groups' efforts?

Work by other WGs can inform us, but different groups have used  
different approaches (e.g reusing DOMException versus defining their  
own). I think that we should strive to have this discussion once, and  
reuse the same mechanism for all of our APIs because I think we have  
every reason to make them coherent in this respect and because  
otherwise we'll just have this same discussion as many times as there  
are APIs.

For instance, BONDI uses interfaces rather than WebIDL exceptions to  
define its exceptions because the latter don't support inheritance and  
"therefore no hierarchy of exceptions can be built"[0]. That's  
something we have to decide.

CDF spent a fair amount of energy discussing this, and since all of  
the DOM specs use DOMException, they had to co-ordinate just to add a  
code[1]. It's not the end of the world, but it's not ideal. The SVG WG  
spent an fair amount of time discussing this. It was brought up in the  
Web API WG. Proper exception behaviour was a substantive issue raised  
against DCCI's second LC. I think you might see where I'm going with  
this: I want this issue eating dandelions by the roots before the next  
full moon.

In other words I'm not saying it's necessarily the hardest, most  
technical of debates, just that it needs to be decided. Strawmen and  
proposals welcome.


[0] http://bondi.omtp.org/1.0/apis/BONDI_Interface_Patterns_v1.0.html#errorhandling
[1] http://lists.w3.org/Archives/Member/member-cdf/2006Feb/0094.html

-- 
Robin Berjon - http://berjon.com/
Received on Tuesday, 1 September 2009 09:36:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:38 UTC