Re: [xml] propper error reporting



On Tuesday 09 January 2007 16:32, Daniel Veillard wrote:
However, xmlReportError is static, so that won't work. So my
question is: is there any public API that would produce
formatted error strings from xmlError or do I need to
copy-paste the insides of xmlReportError to my code?

  People want flexibility, so there is the structured error API
which gives all the pieces and let them rearrange their messaging
as they want. Use the structured error API, which should work
with RNG too. That's the only way to cope with the various
conflicting requirements that people put on error reporting.
  You could also somehow copy xmlReportError() too in your own
code if you don't want to switch to the new APIs.

Ok, thanks. I can try using structured errors exclusively in the 
internals I'd still need some function to produce text messages out 
of them. I think a public function producing some normalized (I 
mean xmllint-like) error message out of the xmlError struct would 
be nice.

My concern is that if I format xmlError into a string myself (using 
code copied from xmlReportError) and then you add some new type of 
messages for some new subsystem, I will have to update my code to 
be able to produce the right formatting for the new type of 
messages.

-- Petr



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