class documentation
class FailureConverter(ABC): (source)
Known subclasses: temporalio.converter.DefaultFailureConverter
Base failure converter to/from errors.
Note, for workflow exceptions, to_failure is only invoked if the
exception is an instance of temporalio.exceptions.FailureError.
Users should extend temporalio.exceptions.ApplicationError if
they want a custom workflow exception to work with this class.
| Method | from |
Convert the given Temporal failure to an exception. |
| Method | to |
Convert the given exception to a Temporal failure. |
| Class Variable | default |
Default failure converter. |
@abstractmethod
def from_failure(self, failure:
def from_failure(self, failure:
temporalio.api.failure.v1.Failure, payload_converter: PayloadConverter) -> BaseException:
(source)
¶
overridden in
temporalio.converter.DefaultFailureConverterConvert the given Temporal failure to an exception.
Users should make sure not to alter the failure input.
| Parameters | |
failure:temporalio.api.failure.v1.Failure | The failure to convert. |
payloadPayloadConverter | The payload converter to use if needed. |
| Returns | |
BaseException | Converted error. |
@abstractmethod
def to_failure(self, exception:
def to_failure(self, exception:
BaseException, payload_converter: PayloadConverter, failure: temporalio.api.failure.v1.Failure):
(source)
¶
overridden in
temporalio.converter.DefaultFailureConverterConvert the given exception to a Temporal failure.
Users should make sure not to alter the exception input.
| Parameters | |
exception:BaseException | The exception to convert. |
payloadPayloadConverter | The payload converter to use if needed. |
failure:temporalio.api.failure.v1.Failure | The failure to update with error information. |