Hello all, the error interception functions are pretty useful. My "feature request" here is whether it could be possible to overcome:
"XQuery runtime errors can be processed via /error annotations/. A single argument must be supplied, which represents the QName of the error to be caught. A wildcard |*| may be specified to catch all possible errors. A function can only have a single error annotation:"
It could be useful to have at least a second level of wildcards on the QName prefix in order to be able to differentiate behaviours according to categories of errors.
|%rest:error||(||"ns1:*"||)|
A more fine grained filtering (i.e. comma separated list of exception codes) could also be useful but since I don't understand the difficulty of building this into the code I won't ask too much. The only alternative I see at the moment is a single function with a switch or a lot of replicated functions. What is your opinion on this?
Thanks and regards, Marco.
Hi Marco,
adding wildcard support to the %restxq:error annotation shouldn't be that much effort. We may need to clarify, however, what is going to happen if more than one candidate is found for an error message. I've added an issue [1]
Christian
[1] https://github.com/BaseXdb/basex/issues/915
On Wed, Mar 26, 2014 at 11:09 AM, Marco Lettere m.lettere@gmail.com wrote:
Hello all, the error interception functions are pretty useful. My "feature request" here is whether it could be possible to overcome:
"XQuery runtime errors can be processed via error annotations. A single argument must be supplied, which represents the QName of the error to be caught. A wildcard * may be specified to catch all possible errors. A function can only have a single error annotation:"
It could be useful to have at least a second level of wildcards on the QName prefix in order to be able to differentiate behaviours according to categories of errors.
%rest:error("ns1:*")
A more fine grained filtering (i.e. comma separated list of exception codes) could also be useful but since I don't understand the difficulty of building this into the code I won't ask too much. The only alternative I see at the moment is a single function with a switch or a lot of replicated functions. What is your opinion on this?
Thanks and regards, Marco.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
And another update (feeling like X-Mas ? ;)...
http://docs.basex.org/wiki/RESTXQ#XQuery_Errors http://files.basex.org/releases/latest/
On Wed, Mar 26, 2014 at 11:09 AM, Marco Lettere m.lettere@gmail.com wrote:
Hello all, the error interception functions are pretty useful. My "feature request" here is whether it could be possible to overcome:
"XQuery runtime errors can be processed via error annotations. A single argument must be supplied, which represents the QName of the error to be caught. A wildcard * may be specified to catch all possible errors. A function can only have a single error annotation:"
It could be useful to have at least a second level of wildcards on the QName prefix in order to be able to differentiate behaviours according to categories of errors.
%rest:error("ns1:*")
A more fine grained filtering (i.e. comma separated list of exception codes) could also be useful but since I don't understand the difficulty of building this into the code I won't ask too much. The only alternative I see at the moment is a single function with a switch or a lot of replicated functions. What is your opinion on this?
Thanks and regards, Marco.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de