GNOME Bugzilla – Bug 172740
Allow failure in (error) callbacks
Last modified: 2006-10-12 14:12:49 UTC
libxml2 currently doesn't allow error callbacks to fail (a python callback's exception is ignored, for example). If python users use libxml2 with python callbacks, they expect exceptions generated in their callbacks to be passed through to the (python) code calling into libxml2, as they should not have to be aware of libxml2 being a C library. For the special case of python the function 'PyErr_Occured()' will return 1 to indicate the the runtime contains a yet-to-be-processed exception. A general mechanism may be provided for libxml2 to check success after callbacks have been called, and abort in case of an error.
There is an xmlStopParser call that callbacks can use to force stopping processing. W.r.t. propagating exceptions from Python -> C -> python I have no idea how to do this. Sorry. If you have a patch why not but I don't think I will add this, closing with WONTFIX, because honnestly that's what will happen unless I get patch/examples... Daniel