W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2004

[XQuery] Error Handling ?

From: Xavier Franc <xfranc@online.fr>
Date: Sun, 01 Feb 2004 00:06:19 +0100
Message-ID: <401C34EB.7050505@online.fr>
To: public-qt-comments@w3.org


This is a badly lacking feature in XQuery:
AFAIK, there is no way to recover/catch a dynamic error after it happens.

Actually, at least two kinds of dynamic errors should be distinguished:
fatal / non-fatal, or non-recoverable / recoverable
(XSLT2 has this distinction).

Clearly there is a semantic difference between:
1)  a wrong regular expression: this is a programming error,
      there is no real point to recover it
2) trying to parse a document is an environment-dependent
    operation, that may fail for unpredictable reasons:
  there isdefinitely a need to recover such an error

Two possible solutions:

1) introduce an error catching mechanism
     -- in my implementation (Qizx/open) I have simply added a 
catch-error() function.
    But a more sophisticated mechanism (try/catch) would probably be better.

2) at the very least, consider modifying some functions like doc()
  so that they return a conventional value (eg the empty sequence)
  instead of raising an error
Received on Saturday, 31 January 2004 18:08:09 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:16 UTC