Every error zuhtml raises is a condition of class zuhtml_error with one
more specific subclass. Handle them by class, for example with
tryCatch(..., zuhtml_limit_error = function(e) ...), never by matching
the message text, which may change.
Details
zuhtml_input_error: an argument is invalid, for examplexis not a single string or raw vector, a file does not exist, a URL or connection cannot be opened or read, or a limit is not a whole number in range. Fieldargnames the argument.zuhtml_encoding_error: raw input cannot be decoded: an unknown encoding, a byte sequence invalid in the declared encoding, or a byte-order mark that contradictsencoding. Fieldencoding.zuhtml_limit_error: a resource limit fromhtml_limits()was exceeded. Fieldslimit(its name, such as"max_depth"),maximum(its value) andobserved(the value that tripped it, where known). Nothing is returned and all native memory is released.zuhtml_parse_error: an internal invariant of the parser failed. This is a bug; please report it.zuhtml_pointer_error: a document is no longer available, for example because it was restored from a saved R session. Parse the HTML again.
Recoverable HTML errors, such as a missing end tag, are not conditions:
they are repaired as a browser would repair them and recorded for
html_problems().