Class CheckedExceptionWrapper

  • All Implemented Interfaces:
    java.io.Serializable

    public final class CheckedExceptionWrapper
    extends java.lang.RuntimeException
    Do not reference directly by the application level code. Use Workflow.wrap(Exception) inside a workflow code and Activity.wrap(Exception) 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.Exception unwrap​(java.lang.Throwable e)
      Removes CheckedException wrapper from the whole chain of Exceptions.
      static java.lang.RuntimeException wrap​(java.lang.Throwable e)
      Returns CheckedExceptionWrapper if e is checked exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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.Exception unwrap​(java.lang.Throwable e)
        Removes CheckedException wrapper from the whole chain of Exceptions. Assumes that wrapper always has a cause which cannot be a wrapper.