Re: [WebIDL] Exceptions

On Thu, 7 Jul 2011, Jonas Sicking wrote:
> On Thu, Jul 7, 2011 at 12:47 PM, Ian Hickson <ian@hixie.ch> 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.
> 
> Ok, let me know once this has been resolved and we can remove this from 
> the list of arguments at that time.

That we are not coordinating well today is not a valid argument for making 
it easier for us to not coordinate, IMHO.


> > Are there exceptions that can be legitimately thrown by JS that aren't 
> > programming bugs?
> 
> Don't know. Are there ones that can be thrown by the DOM that aren't 
> programming bugs?

Sure, QUOTA_EXCEEDED_ERR, for instance. But I take your point.


> > 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.
> 
> This is an attempt to fix this problem. We're already in the state where 
> we have two different exception systems. This is an attempt to create 
> just one. The one used by ES. I'm definitely not suggesting that the 
> existing exceptions thrown by various specs should *not* have a .name 
> and should not inherit Exception. I think all exceptions should be 
> changed to follow that model.

I support anything that makes the platform more consistent. My impression 
was that the proposals so far would make the platform less consistent, by 
having some exceptions caught based on their type (instanceof TypeError), 
and some by their code (.code == Exception.SYNTAX_ERR).

If the proposal is to make all exceptions have a "name" property (or 
whatever we call it) whether in ES, in DOM, or anywhere else, and to have 
everyone pick consistent exception names, then I'm fine with that. If we 
do do that then I'd still say we should just have one exception interface 
object, or at least no more objects than we have today, purely because 
there would be no advantage to having more in such a situation. (I'd also 
suggest we keep giving exceptions codes, so that there aren't some 
exceptions that use codes and others that only have a name, but that's not 
a big deal.)


On Fri, 8 Jul 2011, Robin Berjon wrote:
> 
> Obviously we should coordinate, but coordination is time-consuming.

Coordinating exceptions codes is just a matter of checking a wiki page. 
It's hardly 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.

A huge part of the problem here is we have too many groups in the first 
place.


On Fri, 8 Jul 2011, Aryeh Gregor wrote:
> 
> I still think the .code system is bad

I'm not arguing in favour of .code.


> For instance, I don't get why we need FileError and FileException 
> duplicating NOT_FOUND_ERR, SECURITY_ERR, and ABORT_ERR (with different 
> codes!) from DOMException and adding NOT_READABLE_ERR and ENCODING_ERR.  
> Why can't we just add those to DOMException?

Exactly. This is the kind of problem that occurs if we can avoid 
coordination. We shouldn't avoid coordination.

Authors don't care that there's six working groups or twelve. They just 
have one platform they're authoring to. We need to act like one.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 8 July 2011 19:57:16 UTC