Re: ISSUE-179: DOM Core uses INVALID_STATE_ERR (DOMException) where D3E uses DISPATCH_REQUEST_ERR (EventException)

Jacob Rossi:
>> Per the working group's discussion in the 5/5/2011 teleconference, we
>> have rejected this issue. We find it useful to have a unique exception
>> name for this case. The more descriptive name provides more context
>> for the error at hand; making debugging easier. Additionally, not
>> overloading INVALID_STATE_ERROR is preferable for SEO of specs and
>> other documentation to help understand the error.

Anne van Kesteren:
> I do not think it makes sense to have EventException solely for this.
> Especially as INVALID_STATE_ERR matches the semantics perfectly fine.
> And if people want to find out why dispatchEvent fires an exception they
> can find out by searching for dispatchEvent. Given the way we have used
> exceptions throughout the web platform to date documentation would have
> to scope exceptions to methods anyway. We do not introduce new
> exceptions for one method generally.

This goes back to what our plan for exceptions going forward is going to 
be.  I think there were three viable options (ignoring the 
exception-name-as-string issue):

    1. Have some specs define separate IDL exceptions with possibly
       overlapping codes.
   2a. Have a single IDL exception, DOMException, and coordinate on
       codes so as not to conflict.
   2b. Have a single IDL exception, DOMException, don't mint any new
       integer codes, and discriminate based on name only.
    3. Use an IDL exception per current exception code, don't mint
       integer codes going forward, and discriminate on name only.
       (This was the proposal from Jonas and me.)

I think (1), which is what keeping a separate EventException/
DISPATCH_REQUEST_ERR is the worst of these.  Although I will note that 
DISPATCH_REQUEST_ERR is defined to be 0 in DOM 3 Events, which seems at 
odds with the numbering scheme of DOMException, where they start from 1. 
  Integer codes suck...

Received on Monday, 1 August 2011 04:20:14 UTC