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
jQuery.parseXML should add detailed information about parse errors #4784
Comments
Thanks for the report. However, the test case attached doesn't work, it even doesn't include jQuery. Please share a test case where the issue and what you'd expect instead can be reproduced. |
I'm sorry I have not described the testcase properly. |
What do you propose us to change? |
I propose to add the xml.getElementsByTagName( "parsererror" )[0].innerText to the text of the thrown Error. |
I like this idea. I'd much prefer to either show the parserror content (with provided snippet) or a generic message without trying to add the data to the string. |
PR: #4816 |
Description
If an invalid XML is passed to jQuery.parseXML, currently the thrown parse error only contain the input data but not the error reason.
However the internally created XML document contains the parser errors in the element parsererror as innerText and could be added. This is helpful for debugging errors in XML files
Link to test case
https://jsfiddle.net/o678xuz3/
The text was updated successfully, but these errors were encountered: