Re: [webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-15 Thread Alexey Proskuryakov
14.11.2011, в 18:45, Michael Nordman написал(а): Afaict, the platform does define a means of expressing exceptional conditions including a means of conveying a message that ideally provides useful information. I'd like to fill in that useful information part, INVALID_STATE_ERR: DOM

[webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-14 Thread Michael Nordman
I have a case where given an IDL defined method thats defined to raise a DOMException, I'd like to set a custom exception message from within the webcore implementation and have that message percolate up into script via the bindings layer(s) and be accessible as the exception.message attribute. I

Re: [webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-14 Thread Adam Barth
I'm not sure exactly what you're trying to do, but one option is to add a new type of DOMException: http://trac.webkit.org/browser/trunk/Source/WebCore/dom/DOMExceptions.in Another option is to customize the message from an existing exception (here are the DOMCore exceptions):

Re: [webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-14 Thread Adam Barth
For SQLException, there are a hundred exception codes reserved,     static const int SQLExceptionOffset = 1000;     static const int SQLExceptionMax = 1099; of which, we appear to only be using eight. It sounds like you're considering exposing more than a finite enumerated number of error

Re: [webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-14 Thread Michael Nordman
On Mon, Nov 14, 2011 at 5:17 PM, Adam Barth aba...@webkit.org wrote: For SQLException, there are a hundred exception codes reserved, static const int SQLExceptionOffset = 1000; static const int SQLExceptionMax = 1099; of which, we appear to only be using eight. It sounds like

Re: [webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-14 Thread Adam Barth
On Mon, Nov 14, 2011 at 5:41 PM, Michael Nordman micha...@google.com wrote: On Mon, Nov 14, 2011 at 5:17 PM, Adam Barth aba...@webkit.org wrote: For SQLException, there are a hundred exception codes reserved,     static const int SQLExceptionOffset = 1000;     static const int

Re: [webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-14 Thread Michael Nordman
I sure hope specific exception messages are not getting codified in specs. I don't see where the discussion of other browsers is relevant becaus it's pretty clear other impls of this component aren't going to happen, yet this remains a useful feature of webkit/chrome for the time being. It has

Re: [webkit-dev] Custom exception messages for IDL defined methods that raise DOMException.

2011-11-14 Thread Adam Barth
On Mon, Nov 14, 2011 at 6:45 PM, Michael Nordman micha...@google.com wrote: I sure hope specific exception messages are not getting codified in specs. Many folks in the web standards community would disagree. For example, the DOM4 effort is specifying these sorts of things: