|
Adding a few utility methods to ExceptionUtil:
- a method to help palliating the absence of multi-catch in Java<7 : useful in scenarios when several checked exceptions must be treated the same way then rethrown (typical in filters) (rethrow(e, allowedTypes..))
- a method to go through the stack of "causes" of a given exception to see if there's a cause of a given type (wasCauseBy}(e, suspectedCause)
- a method to turn exception class names into useful information. Typically, JCR exceptions have meaningful names and their "message" is meaningless on its own: PathNotFoundException("/foo/bar") can be turned into "Path not found: /foo/bar". (exceptionToWords(e))
|