-
Notifications
You must be signed in to change notification settings - Fork 606
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
Uncaught error when tag contains multiple invalid attributes #239
Comments
Workaround to Leonidas-from-XIV/node-xml2js#239
As you discovered @knolleary, this only happens when there is more than one error in any chunk of XML being parsed. As this chunk has two If you had an XML string of Commenting out this line of code seems to solve the issue of not catching the subsequent errors. But they are still being emitted. This change passes all tests. I wonder how this would affect things in the wild. https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/src/xml2js.coffee#L383 |
Good question. I've only added it as people like to reuse the parser object for multiple parses (which I recommend against in any case), but I would be open to removing it and seeing how many issues are reported. |
fixed in #240 |
If an XML tag contains more than one invalid attribute, such as
<one two three>
, andparseString
is used in async mode, it throws an uncaught error. If the tag contains only one invalid attribute , it doesn't throw the error.This appears to have been broken by this commit: b4ccc87
Here is a testcase:
Expected result - the callback receives the error:
Actual result - the callback receives the error and an uncaught error is throw:
The text was updated successfully, but these errors were encountered: