Project

Profile

Help

error-handling documentation?

Added by Anonymous over 18 years ago

Legacy ID: #3411731 Legacy Poster: Brian Bailey (bpbailey)

Where might I find documentation for Java error handling? I noticed that Saxon outputs a nice error message such as "XQuery syntax error on line 1 of ... in doc('books.xml')//: Unexpected token "<eof>" in path expression" This message contains some interesting information such as line number and error detail. I would like to do something with this information when I capture a DynamicError or StaticError.


Replies (1)

RE: error-handling documentation? - Added by Anonymous over 18 years ago

Legacy ID: #3411782 Legacy Poster: Michael Kay (mhkay)

The information is all held in the Exception object, though not necessarily in a very direct way. I suggest you study the source code of the StandardErrorListener (and its XQuery adn XSLT subclasses) to see how the location message is built. And of course the JavaDoc describes the different kinds of Exception that can be thrown. Be aware that the information in the exception is pretty variable, and anything that examines it has to be prepared for any part of it to be absent. Michael Kay

    (1-1/1)

    Please register to reply