Package org.hibernate.testing.util
Class ExceptionUtil
- java.lang.Object
-
- org.hibernate.testing.util.ExceptionUtil
-
public class ExceptionUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Throwable
findCause(Throwable t, Class<? extends Throwable> causeClass)
Get a specific cause.static ExceptionUtil
getInstance()
static boolean
isConnectionClose(Exception e)
Was the given exception caused by a SQL connection closestatic boolean
isSqlLockTimeout(Exception e)
Was the given exception caused by a SQL lock timeout?static Throwable
rootCause(Throwable t)
Get the root cause of a particularThrowable
-
-
-
Method Detail
-
getInstance
public static ExceptionUtil getInstance()
-
rootCause
public static Throwable rootCause(Throwable t)
Get the root cause of a particularThrowable
- Parameters:
t
- exception- Returns:
- exception root cause
-
findCause
public static Throwable findCause(Throwable t, Class<? extends Throwable> causeClass)
Get a specific cause.- Parameters:
t
- exceptioncauseClass
- 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
-
-