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
We are occasionally running into a problem, where our upstream API provider is sending an empty XML document. Rather than rescuing RuntimeError and then parsing the error message, it would be more idiomatic to be able to rescue something like EmptyDocumentError.
The text was updated successfully, but these errors were encountered:
I'd prefer to raise a SyntaxError, as we've standardized the XML DOM strict parsing on MRI and JRuby to do this (see #1005 for details).
I think that will have to suffice, since I don't believe the SAX parser errors differentiate between an empty document and a set of other invalid-document errors.
When an empty document gets returned, would it be possible to throw a more specific error?
The current code (https://github.com/sparklemotion/nokogiri/blob/master/ext/java/nokogiri/XmlSaxParserContext.java#L263-L264) throws a
RuntimeError
. Could you return something likeEmptyDocumentError < RuntimeError
?We are occasionally running into a problem, where our upstream API provider is sending an empty XML document. Rather than rescuing
RuntimeError
and then parsing the error message, it would be more idiomatic to be able to rescue something likeEmptyDocumentError
.The text was updated successfully, but these errors were encountered: