ApplicationFailure
extends TemporalFailure
in package
Application failure is used to communicate application specific failures between workflows and activities.
Throw this exception to have full control over type and details if the exception delivered to the caller workflow or client.
Any unhandled exception which doesn't extend [](TemporalFailure) is converted to an instance of this class before being returned to a caller.
The type property is used by [](io.temporal.common.RetryOptions) to determine if an instance of this exception is non retryable. Another way to avoid retrying an exception of this type is by setting nonRetryable flag to @{code true}.
The conversion of an exception that doesn't extend [](TemporalFailure) to an ApplicationFailure is done as following:
- type is set to the exception full type name.
- message is set to the exception message
- nonRetryable is set to false
- details are set to null
- stack trace is copied from the original exception
Table of Contents
Properties
- $details : ValuesInterface
- $failure : Failure|null
- $nextRetryDelay : DateInterval|null
- $nonRetryable : bool
- $originalMessage : string
- $originalStackTrace : string|null
- $type : string
Methods
- __construct() : mixed
- __toString() : string
- getDetails() : ValuesInterface
- getFailure() : Failure|null
- getNextRetryDelay() : DateInterval|null
- getOriginalMessage() : string
- getOriginalStackTrace() : string|null
- getType() : string
- hasOriginalStackTrace() : bool
- isNonRetryable() : bool
- setDataConverter() : void
- setFailure() : void
- setNextRetryDelay() : void
- setNonRetryable() : void
- setOriginalStackTrace() : void
- buildMessage() : string
- Explain known types of key=>value pairs.
Properties
$details
private
ValuesInterface
$details
$failure
private
Failure|null
$failure
= null
$nextRetryDelay
private
DateInterval|null
$nextRetryDelay
= null
$nonRetryable
private
bool
$nonRetryable
$originalMessage
private
string
$originalMessage
$originalStackTrace
private
string|null
$originalStackTrace
= null
$type
private
string
$type
Methods
__construct()
public
__construct(string $message, string $type, bool $nonRetryable[, ValuesInterface|null $details = null ][, Throwable|null $previous = null ][, DateInterval|null $nextRetryDelay = null ]) : mixed
Parameters
- $message : string
- $type : string
- $nonRetryable : bool
- $details : ValuesInterface|null = null
-
Optional details about the failure.
- $previous : Throwable|null = null
- $nextRetryDelay : DateInterval|null = null
-
Delay before the next retry attempt.
__toString()
public
__toString() : string
Return values
stringgetDetails()
public
getDetails() : ValuesInterface
Return values
ValuesInterfacegetFailure()
public
getFailure() : Failure|null
Return values
Failure|nullgetNextRetryDelay()
public
getNextRetryDelay() : DateInterval|null
Return values
DateInterval|nullgetOriginalMessage()
public
getOriginalMessage() : string
Return values
stringgetOriginalStackTrace()
public
getOriginalStackTrace() : string|null
Return values
string|nullgetType()
public
getType() : string
Return values
stringhasOriginalStackTrace()
public
hasOriginalStackTrace() : bool
Tags
Return values
boolisNonRetryable()
public
isNonRetryable() : bool
Return values
boolsetDataConverter()
public
setDataConverter(DataConverterInterface $converter) : void
Parameters
- $converter : DataConverterInterface
setFailure()
public
setFailure(Failure|null $failure) : void
Parameters
- $failure : Failure|null
setNextRetryDelay()
public
setNextRetryDelay(DateInterval|null $nextRetryDelay) : void
Parameters
- $nextRetryDelay : DateInterval|null
setNonRetryable()
public
setNonRetryable(bool $nonRetryable) : void
Parameters
- $nonRetryable : bool
setOriginalStackTrace()
public
setOriginalStackTrace(string $stackTrace) : void
Parameters
- $stackTrace : string
buildMessage()
Explain known types of key=>value pairs.
protected
static buildMessage(array<string|int, mixed> $values) : string
Parameters
- $values : array<string|int, mixed>