-
Available since OmniFaces 1.0
Collection of general utility methods with respect to working with exceptions. So far there's only an unwrapper and a type checker.
Usage
Here are some examples:
// Check if the caught exception has a ConstraintViolationException in its hierarchy.
catch (PersistenceException e) {
if (Exceptions.is(e, ConstraintViolationException.class)) {
// ...
}
}
// Unwrap the caught FacesException until a non-FacesException is found.
catch (FacesException e) {
Exception realRootCause = Exceptions.unwrap(e, FacesException.class);
// ...
}
For a full list, check the method summary.
Feature request
If you know more useful methods/functions which you think should be added to this OmniFaces utility class so that everyone can benefit from a "standard" Faces utility library, feel free to post a feature request.
Documentation & Sources