Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handlers not set correctly #23

Closed
tewha opened this issue Feb 25, 2013 · 2 comments
Closed

Error handlers not set correctly #23

tewha opened this issue Feb 25, 2013 · 2 comments

Comments

@tewha
Copy link

tewha commented Feb 25, 2013

Per the libxml2 documentation for xmlSetStructuredErrorFunc:

Function to reset the handler and the error context for out of context structured error messages. This simply means that @handler will be called for subsequent error messages while not parsing nor validating. And @ctx will be passed as first argument to @handler For multi-threaded applications, this must be set separately for each thread.

Unfortunately, KissXML only attempts to set these functions as part of +initialize. Instead, they need to be installed each time a call is made into the library that could fail.

This is probably a fairly large issue, and potentially unfixable at the library level; having a public class method to install the error handlers would probably be sufficient. This way, code intentionally using KissXML off the main thread could specifically initialize the error handlers.

@tewha
Copy link
Author

tewha commented Feb 25, 2013

I take back this being a difficult problem to solve in the library: There are only a couple places where KissXML checks the error. It's easy enough to call a new [DDXMLNode installErrorHandlersInThread] there.

@tewha
Copy link
Author

tewha commented Feb 25, 2013

Obsoleted by pull request #24.

@tewha tewha closed this as completed Feb 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant