Package com.uber.cadence.internal.common
Class CheckedExceptionWrapper
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.uber.cadence.internal.common.CheckedExceptionWrapper
-
- All Implemented Interfaces:
java.io.Serializable
public final class CheckedExceptionWrapper extends java.lang.RuntimeException
Do not reference directly by the application level code. UseWorkflow.wrap(Exception)
inside a workflow code andActivity.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.
-
-
-
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.
-
-