Interface: FailureConverter
common.FailureConverter
A FailureConverter
is responsible for converting from proto Failure
instances to JS Errors
and back.
We recommended using the DefaultFailureConverter instead of customizing the default implementation in order to maintain cross-language Failure serialization compatibility.
Implemented by
Methods
errorToFailure
▸ errorToFailure(err
, payloadConverter
): IFailure
Converts a caught error to a Failure proto message.
Parameters
Name | Type |
---|---|
err | unknown |
payloadConverter | PayloadConverter |
Returns
failureToError
▸ failureToError(err
, payloadConverter
): TemporalFailure
Converts a Failure proto message to a JS Error object.
The returned error must be an instance of TemporalFailure
.
Parameters
Name | Type |
---|---|
err | IFailure |
payloadConverter | PayloadConverter |