Class CheckedExceptionWrapper

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.temporal.serviceclient.CheckedExceptionWrapper
All Implemented Interfaces:
Serializable

public final class CheckedExceptionWrapper extends RuntimeException
Do not reference directly by the application level code. Use io.temporal.workflow.Workflow#wrap(Exception) inside a workflow code and io.temporal.activity.Activity#wrap(Throwable) inside an activity code instead.
See Also:
  • Method Details

    • wrap

      public static RuntimeException wrap(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 Throwable unwrap(Throwable e)
      Removes CheckedExceptionWrapper from the top of the chain of Exceptions. Assumes that wrapper always has a cause which cannot be a wrapper.