Exceptions - xmlunit/user-guide GitHub Wiki
Exceptions
One thing that makes working with JAXP tedious is the plethora of checked exceptions declared for almost any method one would want to use. The lack of checked exceptions in .NET means only XMLUnit for Java needed to deal with this.
XMLUnit for Java doesn't specify any checked exceptions inside its
public API. Rather than that it catches all the fancy
TransformerConfigurationException
s and friends, wraps them into
XMLUnitException
(which are RuntimeException
s) and rethrows
them. Only using RuntimeException
s is a conscious decision that
greatly simplifies the API.
There is a special subclass ConfigurationException
of
XMLUnitException
that is used to wrap the various
*ConfigurationException
s of JAXP.