Class ExceptionUtil


  • public class ExceptionUtil
    extends Object
    • Method Detail

      • rootCause

        public static Throwable rootCause​(Throwable t)
        Get the root cause of a particular Throwable
        Parameters:
        t - exception
        Returns:
        exception root cause
      • findCause

        public static Throwable findCause​(Throwable t,
                                          Class<? extends Throwable> causeClass)
        Get a specific cause.
        Parameters:
        t - exception
        causeClass - cause type
        Returns:
        exception root cause
      • isSqlLockTimeout

        public static boolean isSqlLockTimeout​(Exception e)
        Was the given exception caused by a SQL lock timeout?
        Parameters:
        e - exception
        Returns:
        is caused by a SQL lock timeout
      • isConnectionClose

        public static boolean isConnectionClose​(Exception e)
        Was the given exception caused by a SQL connection close
        Parameters:
        e - exception
        Returns:
        is caused by a SQL connection close