class LibXML::XML::Error

The XML::Error class exposes libxml errors as standard Ruby exceptions. When appropriate, libxml-ruby will raise an exception - for example, when parsing a non-well formed xml document.

By default, warnings, errors and fatal errors that libxml generates are printed to STDERR via the XML::Error::VERBOSE_HANDLER proc.

To disable this output you can install the quiet handler:

XML::Error.set_handler(&XML::Error::QUIET_HANDLER)

Get the current handler:

proc = XML::Error.get_handler

Install your own handler:

XML::Error.set_handler do |error|
  puts error.to_s
end

Or remove all handlers:

XML::Error.reset_handler