Package com.seeq.utilities.exception
Class SeeqExceptions
java.lang.Object
com.seeq.utilities.exception.SeeqExceptions
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the first Throwable matching the given class in the cause chain beginning with the provided ThrowableGet the chain of Throwable causes, including the initial Throwable.<T extends Throwable>
booleanCheck the chain of Throwable causes to see if the expected cause is someone in the "cause chain"static boolean
isCausedByInterruption
(Throwable throwable) Check the chain of Throwable causes to see if the cause contains an InterruptedException or OperationCanceledException
-
Constructor Details
-
SeeqExceptions
public SeeqExceptions()
-
-
Method Details
-
getCauses
Get the chain of Throwable causes, including the initial Throwable.- Parameters:
throwable
- the root Throwable whose causes to follow- Returns:
- The ordered stream of Throwables via getCause, where the first element is the first argument
-
getCause
Get the first Throwable matching the given class in the cause chain beginning with the provided Throwable- Type Parameters:
T
- the type of the cause to check for- Parameters:
throwable
- the throwable where the causes will be inspectedcauseToCheck
- the cause to check for- Returns:
- The first matching
cause
is in the cause chain ofthrowable
, otherwise empty.
-
hasCause
Check the chain of Throwable causes to see if the expected cause is someone in the "cause chain"- Type Parameters:
T
- the type of the cause to check for- Parameters:
throwable
- the throwable where the causes will be inspectedcauseToCheck
- the cause to check for- Returns:
- true if
cause
is in the cause chain ofthrowable
-
isCausedByInterruption
Check the chain of Throwable causes to see if the cause contains an InterruptedException or OperationCanceledException- Parameters:
throwable
- the throwable where the causes will be inspected- Returns:
- true if the chain of
throwable
contains an InterruptedException or OperationCanceledException
-