W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: Exceptions for DOM-XPath

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 10 Apr 2012 21:38:25 +0200
To: public-webapps@w3.org
Message-ID: <op.wckd6bmq64w2qv@annevk-macbookpro.local>
On Tue, 10 Apr 2012 21:30:02 +0200, Jonas Sicking <jonas@sicking.cc> wrote:
> We're currently cleaning out some of our error handling code and the
> turn has come to XPathException. The DOM4+WebIDL specs has created a
> nice set of exceptions which make it easier for authors to check for
> specific exceptions. You now only have to check .name (which is a
> string) rather than .code (which is a "magic" number) and which
> interface it implements (DOMException vs. Error vs. XPathException
> etc).
>
> So our plan is to for INVALID_EXPRESSION_ERR throw a "SyntaxError"
> (I.e. a DOMException) and for TYPE_ERR throw a plain JS TypeError.
>
> Unfortunately the DOM-XPath spec is no longer being maintained so
> there is noone to issue an Errata, but if this change sounds good to
> everyone we'll just update our documentation which should hopefully be
> enough to get authors aware.

I (and others) maintain errata here for now:  
http://wiki.whatwg.org/wiki/DOM_XPath

I guess we should also figure out how to deal with Attr nodes -> Attr  
objects.


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Tuesday, 10 April 2012 19:38:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:51 GMT