Class ExceptionUtils


  • public class ExceptionUtils
    extends java.lang.Object
    Utilities for handling Throwables and Exceptions.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExceptionUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void handleThrowable​(java.lang.Throwable t)
      Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others.
      static java.lang.Throwable unwrapInvocationTargetException​(java.lang.Throwable t)
      Checks whether the supplied Throwable is an instance of InvocationTargetException and returns the throwable that is wrapped by it, if there is any.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionUtils

        public ExceptionUtils()
    • Method Detail

      • handleThrowable

        public static void handleThrowable​(java.lang.Throwable t)
        Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others.
        Parameters:
        t - the Throwable to check
      • unwrapInvocationTargetException

        public static java.lang.Throwable unwrapInvocationTargetException​(java.lang.Throwable t)
        Checks whether the supplied Throwable is an instance of InvocationTargetException and returns the throwable that is wrapped by it, if there is any.
        Parameters:
        t - the Throwable to check
        Returns:
        t or t.getCause()