Package io.temporal.serviceclient
Class CheckedExceptionWrapper
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.temporal.serviceclient.CheckedExceptionWrapper
-
- All Implemented Interfaces:
java.io.Serializable
public final class CheckedExceptionWrapper extends java.lang.RuntimeExceptionDo not reference directly by the application level code. Useio.temporal.workflow.Workflow#wrap(Exception)inside a workflow code andio.temporal.activity.Activity#wrap(Throwable)inside an activity code instead.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Throwableunwrap(java.lang.Throwable e)Removes CheckedExceptionWrapper from the top of the chain of Exceptions.static java.lang.RuntimeExceptionwrap(java.lang.Throwable e)Returns CheckedExceptionWrapper if e is checked exception.
-
-
-
Method Detail
-
wrap
public static java.lang.RuntimeException wrap(java.lang.Throwable e)
Returns CheckedExceptionWrapper if e is checked exception. If there is a need to return a checked exception from an activity or workflow implementation throw a wrapped exception it using this method. The library code will unwrap it automatically when propagating exception to the caller.try { return someCall(); } catch (Exception e) { throw CheckedExceptionWrapper.wrap(e); }
-
unwrap
public static java.lang.Throwable unwrap(java.lang.Throwable e)
Removes CheckedExceptionWrapper from the top of the chain of Exceptions. Assumes that wrapper always has a cause which cannot be a wrapper.
-
-