- From: John Lumley <john@saxonica.com>
- Date: Mon, 25 Nov 2013 11:51:47 +0000
- To: Christian Grün <christian.gruen@gmail.com>
- CC: EXPath ML <public-expath@w3.org>, Jirka Kosek <jirka@kosek.cz>
- Message-ID: <529339D3.5010506@saxonica.com>
On 19/11/2013 11:01, Christian Grün wrote: >> I'm inclinded to have two errors: [index-before-start] and [index-after-end] >> - differentiating between them, which the machine of course can do, makes it >> easier to track the error - before-start is more likely to be $offset wrong >> etc. > I tend to handle semantically similar errors in the same way. As you > already indicated, before-start is “more likely to be $offset wrong”, > but as we don’t have any guarantee, both values need to be checked in > both catch branches to be sure what was going on. Personally, I would > even treat all out-of-bounds errors (incl. negative-offset and > negative-size) with a single code for the very same reason; otherwise, > the resulting XQuery code may get too bloated. What I wouldn’t do, > however, is to also accept and normalize negative values, as has been > done in XPath 1.0. > > Just my two (verbose) cents > Christian > Understood. As Mike pointed out more detailed error information can be provided through messages or the error reporting variables. I've changed the 'index-before-start'/'index-after-end' to a single 'index-out-of-range', though a 'size-negative' has been retained separately. I have to admit the spec looks a bit 'cleaner'! The test case error codes are being changed accordingly (I'll look through your set today.) -- *John Lumley* MA PhD CEng FIEE john@saxonica.com <mailto:john@saxonica.com> on behalf of Saxonica Ltd
Received on Monday, 25 November 2013 11:52:16 UTC