From: Adam R. <ad...@ex...> - 2010-03-17 19:45:11
|
I had a problem with a type data conversion, in this case with effectiveBooleanValue being called on AbstractDateTimeValue. I could not find the cause of the error, and so I 'hacked' the code to push the calling expression into the type comparisson, so that I could then extract the line and column numbers of the calling XQuery to annotate the XPathException that was thrown. This is just a simple example, see the attached diff, but I am wondering if there is value in, expanding on this concept and pushing xquery line context information into the datatype system for better errors. A cleaner approach might be to change the exceptions thrown by the types, then catch them in the expression, add the expression information and then throw them as XPathExceptions? The following xquery - if(current-dateTime())then () else() Will cause the error I was seeing, with my patch applied you will also get the line number of where the error in the XQuery occurred. Thoughts please :-) -- Adam Retter eXist Developer { United Kingdom } ad...@ex... irc://irc.freenode.net/existdb |