You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for pointing it out. You are totally right that we need to document this, since error handling in general doesn't work like in any spec.
Ps: The good thing is that xmldom offers an API, so you are in control, some (very small and vague) part of it is documented in the readme (search for errorHandler. You can override the error handling and specify what to do in case of fatalErrors (the ones that throw), errors (only logged by default) and warnings. It's also on option to ignore them in case you pass a noop (() => {}).
There are also quite some tests on the topic that might help you understand how it works.
When parsing an invalid file I have to wrap in a try/catch block.
This seems to go against the spec: https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#error_handling
Not a huge deal, however this is not documented. If this is indeed the intent, the docs should be updated.
The text was updated successfully, but these errors were encountered: