Package de.intarsys.tools.exception
Class ExceptionTools
- java.lang.Object
-
- de.intarsys.tools.exception.ExceptionTools
-
public class ExceptionTools extends java.lang.ObjectTool class for dealing with Exceptions.
-
-
Constructor Summary
Constructors Constructor Description ExceptionTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.IOExceptioncreateIOException(java.lang.String message, java.lang.Throwable cause)static voidfail()Simply fail with aRuntimeException.static <T> TfutureSimpleGet(java.util.concurrent.Future<T> future)static <T extends java.lang.Number>
TfutureSimpleGetNumber(java.util.concurrent.Future<T> future)static java.lang.ThrowablegetInChain(java.lang.Throwable t, java.lang.Class<?> clazz)static java.lang.ThrowablegetRoot(java.lang.Throwable t)The root cause oft.static java.lang.StringgetStackTraceString(java.lang.Throwable t)static booleanisInChain(java.lang.Throwable t, java.lang.Class<?> clazz)static booleanisKnownReason(java.lang.Throwable t)
-
-
-
Method Detail
-
createIOException
public static java.io.IOException createIOException(java.lang.String message, java.lang.Throwable cause)
-
fail
public static void fail()
Simply fail with aRuntimeException.
-
futureSimpleGet
public static <T> T futureSimpleGet(java.util.concurrent.Future<T> future)
-
futureSimpleGetNumber
public static <T extends java.lang.Number> T futureSimpleGetNumber(java.util.concurrent.Future<T> future)
-
getInChain
public static java.lang.Throwable getInChain(java.lang.Throwable t, java.lang.Class<?> clazz)
-
getRoot
public static java.lang.Throwable getRoot(java.lang.Throwable t)
The root cause oft.- Parameters:
t- AThrowable.- Returns:
- The most inner cause of
t.
-
getStackTraceString
public static java.lang.String getStackTraceString(java.lang.Throwable t)
-
isInChain
public static boolean isInChain(java.lang.Throwable t, java.lang.Class<?> clazz)
-
isKnownReason
public static boolean isKnownReason(java.lang.Throwable t)
-
-