Package io.temporal.failure
Class FailureConverter
- java.lang.Object
-
- io.temporal.failure.FailureConverter
-
public class FailureConverter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JAVA_SDK
-
Constructor Summary
Constructors Constructor Description FailureConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.temporal.api.failure.v1.Failure
exceptionToFailure(java.lang.Throwable e)
static io.temporal.api.failure.v1.Failure
exceptionToFailure(java.lang.Throwable e, DataConverter dataConverter)
This method is needed when we need to serialize an exception having aTemporalFailure
instance in the chain withdetails
field and no data converter attached explicitly during creation.static java.lang.RuntimeException
failureToException(io.temporal.api.failure.v1.Failure failure, DataConverter dataConverter)
static boolean
isCanceledCause(java.lang.Throwable exception)
static java.lang.StackTraceElement[]
parseStackTrace(java.lang.String stackTrace)
Parses stack trace serialized usingserializeStackTrace(Throwable)
.static java.lang.String
serializeStackTrace(java.lang.Throwable e)
-
-
-
Field Detail
-
JAVA_SDK
public static final java.lang.String JAVA_SDK
- See Also:
- Constant Field Values
-
-
Method Detail
-
failureToException
public static java.lang.RuntimeException failureToException(io.temporal.api.failure.v1.Failure failure, DataConverter dataConverter)
- Parameters:
failure
- TemporalFailure proto to deserialize into an exceptiondataConverter
- to be used to convertFailure#failure_info#details
if present which contain additional user supplied details.- Returns:
- deserialized exception
-
exceptionToFailure
public static io.temporal.api.failure.v1.Failure exceptionToFailure(java.lang.Throwable e, DataConverter dataConverter)
This method is needed when we need to serialize an exception having aTemporalFailure
instance in the chain withdetails
field and no data converter attached explicitly during creation.
-
exceptionToFailure
public static io.temporal.api.failure.v1.Failure exceptionToFailure(java.lang.Throwable e)
-
parseStackTrace
public static java.lang.StackTraceElement[] parseStackTrace(java.lang.String stackTrace)
Parses stack trace serialized usingserializeStackTrace(Throwable)
.
-
serializeStackTrace
public static java.lang.String serializeStackTrace(java.lang.Throwable e)
-
isCanceledCause
public static boolean isCanceledCause(java.lang.Throwable exception)
-
-