[MAGNOLIA-3876] ExceptionUtil additions Created: 02/Nov/11  Updated: 27/Jan/15  Resolved: 02/Nov/11

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: 4.5

Type: New Feature Priority: Neutral
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MAGNOLIA-3863 An additional security filter which h... Closed
relation
is related to MAGNOLIA-2923 Introducing ExceptionUtil Closed
is related to MAGNOLIA-6051 ExceptionUtil.classNameToWords() and ... Closed
Template:
Acceptance criteria:
Empty

 Description   

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))

Generated at Mon Feb 12 03:50:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.