On Tue, Aug 6, 2013 at 10:03 PM, Brendan Eich <bren...@mozilla.com> wrote:
> That's not the issue. If you don't care about which (whatever the set of
> standard error types), you might as well toss a coin. But clearly we have
> some implicit rule or rules informing when to use RangeError vs. TypeError.
> Or are the rules explicit?
>
> Saying the Java-esque "Error class hierarchy" is not useful for dispatching
> also ignores matching in catch clauses, on the Harmony agenda.
>
> But even if we think everything here is a mistake, it is at least an
> attractive nuisance that trips up developers and other standards'
> caretakers. We need some ground rules and FAQ entries for when to use Type
> vs. Range, and why-no-Value/Domain.

And having this sooner rather than later would be welcome. There's new
APIs coming up that want to mint new types of errors and it seems we
might be stuck with the situation that DOMException.name returns a
specific name rather than "DOMException". We can probably still kill
DOMError, but the alternative should be clear.

If in the end people are expected to check Error.name I don't think it
matters much DOM has a catchall DOMException object that represents a
bunch of distinct names.

And FWIW, the distinct names are occasionally useful for certain APIs,
e.g. when you want to react differently between a network error and an
end-user terminating the operation.

More FWIW, http://dom.spec.whatwg.org/#errors describes the situation
we have today. Timely advice much appreciated.


-- 
http://annevankesteren.nl/
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to