Re: What exception to raise?

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 UTC