class documentation

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_failure Convert the given Temporal failure to an exception.
Method to_failure Convert the given exception to a Temporal failure.
Class Variable default Default failure converter.
@abstractmethod
def from_failure(self, failure: temporalio.api.failure.v1.Failure, payload_converter: PayloadConverter) -> BaseException: (source)

Convert the given Temporal failure to an exception.

Users should make sure not to alter the failure input.

Parameters
failure:temporalio.api.failure.v1.FailureThe failure to convert.
payload_converter:PayloadConverterThe payload converter to use if needed.
Returns
BaseExceptionConverted error.
@abstractmethod
def to_failure(self, exception: BaseException, payload_converter: PayloadConverter, failure: temporalio.api.failure.v1.Failure): (source)

Convert the given exception to a Temporal failure.

Users should make sure not to alter the exception input.

Parameters
exception:BaseExceptionThe exception to convert.
payload_converter:PayloadConverterThe payload converter to use if needed.
failure:temporalio.api.failure.v1.FailureThe failure to update with error information.

Default failure converter.