Handling XML exceptions with the Python API
533313Sep 22 2006 — edited Sep 25 2006Can anyone tell me how to detect and handle DbXML exceptions in Python? The XmlException class is not available in Python, and symbols like DOCUMENT_NOT_FOUND are not defined either.
The most that I have managed to figure out is that a Python exception RuntimeError is thrown (which I can catch in a except clause). I can then get a string using sys.exc_info() (such as "Error: Document not found: blah.xml"). Is there a more reasonable way of catching and handling DbXML errors than by parsing the text of the error message?
Thanks,
Peter.