Every error zuxml raises carries a condition class, so that it can be
caught by kind rather than by matching the message, which is not stable.
Every class below is a subclass of zuxml_error.
Details
zuxml_invalid_argumentAn argument was not usable: an
xthat is not a single string or a raw vector, anencodingother than UTF-8 for character input, a limit that is not a positive whole number, or a flag that is notTRUEorFALSE.zuxml_parse_errorThe input is not well-formed XML, ends too early, or references an undefined entity.
zuxml_encoding_errorThe input is not valid in its encoding, or names an encoding that neither Expat nor
iconv()can read.zuxml_doctype_errorThe document has a
DOCTYPEdeclaration andallow_doctypeisFALSE, or it has an internal subset, which is refused either way.zuxml_limit_errorA resource limit was reached. The subclasses
zuxml_depth_limit,zuxml_node_limit,zuxml_attr_limit,zuxml_text_limitandzuxml_memory_limitname which one.xml_serialize()raises the parent class alone when a node's text is longer than an R string can hold.zuxml_memory_errorAn allocation failed.
zuxml_cancelledA handler stopped the parse. It can only happen through the C API, where a downstream package supplies the handler; no exported R function raises it.
A condition raised by a parse carries line, column and byte_offset,
the position where the parser stopped; status, the C status's enumerator
name, such as "ZUX_ERR_DEPTH_LIMIT"; and expat_code, Expat's own error
code, which is NA when the failure was not Expat's. It is there for
diagnostics: do not branch on it. A limit error also carries limit, the
argument's name, such as "max_depth", and limit_value, the value it was
given. A zuxml_invalid_argument condition carries arg, the name of the
argument at fault.