SAX Parser Reponse to Fata Error



Hello,

I'm using the xmlpp::SaxParser and I'd like to handle a fatal error by
stopping processing, logging it in a file and informing the user.

I noticed that the default response of on_fatal_error() is to throw an
exception, and when the exception is caught, handleException() is
called, and it calls xmlStopParser() which stops the parser, I guess.

But handleException() treats only xmlpp::exception, not ANY exception
I'd throw, for example an exception class I wrote for my own code.

The question is: How do I stop the parser by myself? What would be the
best way to stop the parser when there's a fatal error?

There are many options: use the parser context field directly, or
intentionally throw xmlpp::exception and catch is locally, etc. but I'd
like to know if there's some common way to do it.

Thanks in advance
Anatoly



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]