- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.scijava.ops.spi.OpExecutionException
-
- All Implemented Interfaces:
Serializable
public class OpExecutionException extends RuntimeException
Thrown to indicate that an Op failed in its execution- Author:
- Gabriel Selzer
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOpExecutionException.ThrowingRunnablestatic interfaceOpExecutionException.ThrowingSupplier<T>
-
Constructor Summary
Constructors Constructor Description OpExecutionException(String s)Constructs anOpExecutionExceptionwith the specified reason for failure.OpExecutionException(String message, Throwable cause)Constructs anOpExecutionExceptionwith the specified reason for failure and cause.OpExecutionException(Throwable cause)Constructs anOpExecutionExceptionwith the specified cause.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidwrapAndRun(OpExecutionException.ThrowingRunnable runnable)Runs aRunnablethat throws some checkedException, wrapping theExceptioninto anOpExecutionExceptionif it is thrown.static <T> TwrapAndRun(OpExecutionException.ThrowingSupplier<T> supplier)Runs aSupplierthat throws some checkedException, wrapping theExceptioninto anOpExecutionExceptionif it is thrown.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
OpExecutionException
public OpExecutionException(String s)
Constructs anOpExecutionExceptionwith the specified reason for failure.- Parameters:
s- the reason for the failure
-
OpExecutionException
public OpExecutionException(Throwable cause)
Constructs anOpExecutionExceptionwith the specified cause.- Parameters:
cause- the cause of the failure
-
-
Method Detail
-
wrapAndRun
public static void wrapAndRun(OpExecutionException.ThrowingRunnable runnable)
Runs aRunnablethat throws some checkedException, wrapping theExceptioninto anOpExecutionExceptionif it is thrown.- Parameters:
runnable- theRunnable
-
wrapAndRun
public static <T> T wrapAndRun(OpExecutionException.ThrowingSupplier<T> supplier)
Runs aSupplierthat throws some checkedException, wrapping theExceptioninto anOpExecutionExceptionif it is thrown.- Parameters:
supplier- theSupplier
-
-