Class ExceptionUtil


  • public class ExceptionUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Throwable findCause​(java.lang.Throwable t, java.lang.Class<? extends java.lang.Throwable> causeClass)
      Get a specific cause.
      static ExceptionUtil getInstance()  
      static boolean isConnectionClose​(java.lang.Exception e)
      Was the given exception caused by a SQL connection close
      static boolean isSqlLockTimeout​(java.lang.Exception e)
      Was the given exception caused by a SQL lock timeout?
      static java.lang.Throwable rootCause​(java.lang.Throwable t)
      Get the root cause of a particular Throwable
      • Methods inherited from class java.lang.Object

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

      • rootCause

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

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

        public static boolean isSqlLockTimeout​(java.lang.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​(java.lang.Exception e)
        Was the given exception caused by a SQL connection close
        Parameters:
        e - exception
        Returns:
        is caused by a SQL connection close