Package io.temporal.failure
Class DefaultFailureConverter
- java.lang.Object
-
- io.temporal.failure.DefaultFailureConverter
-
- All Implemented Interfaces:
FailureConverter
public final class DefaultFailureConverter extends java.lang.Object implements FailureConverter
AFailureConverterthat implements the default cross-language-compatible conversion algorithm.
-
-
Constructor Summary
Constructors Constructor Description DefaultFailureConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.temporal.api.failure.v1.FailureexceptionToFailure(java.lang.Throwable throwable, DataConverter dataConverter)Serialize an existing Java Exception into a Failure object.java.lang.RuntimeExceptionfailureToException(io.temporal.api.failure.v1.Failure failure, DataConverter dataConverter)Instantiate an appropriate Java Exception from a serialized Failure object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.temporal.common.converter.FailureConverter
withContext
-
-
-
-
Method Detail
-
failureToException
@Nonnull public java.lang.RuntimeException failureToException(@Nonnull io.temporal.api.failure.v1.Failure failure, @Nonnull DataConverter dataConverter)Description copied from interface:FailureConverterInstantiate an appropriate Java Exception from a serialized Failure object.- Specified by:
failureToExceptionin interfaceFailureConverter- Parameters:
failure- Failure protobuf object to deserialize into an exceptiondataConverter- to be used to convertFailure#encodedAttributesandFailure#failure_info#details(if present).- Returns:
- deserialized exception
-
exceptionToFailure
@Nonnull public io.temporal.api.failure.v1.Failure exceptionToFailure(@Nonnull java.lang.Throwable throwable, @Nonnull DataConverter dataConverter)Description copied from interface:FailureConverterSerialize an existing Java Exception into a Failure object.- Specified by:
exceptionToFailurein interfaceFailureConverter- Parameters:
throwable- A Java Exception object to serialize into a Failure protobuf objectdataConverter- to be used to convertFailure#encodedAttributesandFailure#failure_info#details(if present).- Returns:
- serialized exception
-
-