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

Michael Nordman michaeln at google.com
Mon Nov 14 16:58:13 PST 2011


I guess the exception of interest is  SQLException.

Take a look at Database.cpp line 103. The ' errorMessage' string on that
line contains more detailed information about what went wrong in the act of
opening the database, including things like an sqlite error code and sqlite
error message. These strings are formed in the bowls of
AbstractDatabase::performOpenAndVerify().

On Mon, Nov 14, 2011 at 4:48 PM, Adam Barth <abarth at webkit.org> wrote:

> 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):
>
>
> http://trac.webkit.org/browser/trunk/Source/WebCore/dom/DOMCoreException.cpp
>
> If you show me the spec you're trying to implement, I might have a
> more concept suggestion of the best way to implement it.
>
> Adam
>
>
> On Mon, Nov 14, 2011 at 4:44 PM, Michael Nordman <michaeln at google.com>
> wrote:
> > 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 don't see a non-custom way of doing that and am wondering if there
> should
> > be support for something like this w/o having to resort to custom
> bindings?
> > The particular methods I'm looking at are the openDatabase(...) method of
> > DOMWindow and WorkerContext, but this seems like it might be useful in
> other
> > cases as well.
> >
> > _______________________________________________
> > webkit-dev mailing list
> > webkit-dev at lists.webkit.org
> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20111114/11c7bb07/attachment.html>


More information about the webkit-dev mailing list