Interface ExceptionUtil


public interface ExceptionUtil
Author:
Vlad Mihalcea
  • Field Details

    • LOCK_TIMEOUT_EXCEPTIONS

      static final List<Class<? extends Exception>> LOCK_TIMEOUT_EXCEPTIONS
  • Method Details

    • rootCause

      static <T extends Throwable> T rootCause(Throwable t)
      Get the root cause of a particular Throwable
      Parameters:
      t - exception
      Returns:
      exception root cause
    • isLockTimeout

      static boolean isLockTimeout(Throwable e)
      Is the given throwable caused by a database lock timeout?
      Parameters:
      e - exception
      Returns:
      is caused by a database lock timeout
    • isCausedBy

      static boolean isCausedBy(Throwable e, Class<? extends Throwable> exceptionType)
      Is the given throwable caused by the following exception type?
      Parameters:
      e - exception
      exceptionType - exception type
      Returns:
      is caused by the given exception type
    • isMVCCAnomalyDetection

      static boolean isMVCCAnomalyDetection(Throwable e)
      Is the given throwable caused by a database MVCC anomaly detection?
      Parameters:
      e - exception
      Returns:
      is caused by a database lock MVCC anomaly detection
    • isConnectionClose

      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