W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2003

Re: What exception to raise?

From: Philippe Le Hegaret <plh@w3.org>
Date: 23 Sep 2003 12:24:39 -0700
To: Chris Moschini <cmoschini@myrealbox.com>
Cc: WWW DOM <www-dom@w3.org>
Message-Id: <1064345079.428.49.camel@chacal>

On Tue, 2003-09-23 at 06:38, Chris Moschini wrote:
> Philippe Le Hegaret wrote:
> > When more than one exception is possible, then it
> > doesn't matter which one your implementation chooses
> > to throw, as long as it raises one of them.
> 
> 
> This, I'm sure, is going to irk developers using DOM3. If the precedence is being left undefined so that browser-authors can determine the best error to throw on a case-by-case basis, leaving it out of the scope of the document until, perhaps, DOM4, then I suppose I understand; you can only accomplish so much in one standard.

This has been in DOM since DOM Level 1 and we don't plan to render
current implementations non-conformant.

> But at some point developers will want to be able to predict for any set of errors what one error they will receive. Otherwise, a try/catch in a language like Java or Javascript is going to produce varying results for the same error browser to browser. This is sure to be a sore spot for developers once DOM3 proliferates.

The program is in fault since it's trying to do an invalid operation. If
more than one valid case applies, the program needs to be fixed imho.

Philippe
Received on Tuesday, 23 September 2003 15:24:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:57 GMT