Documentation

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

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.

getFailure()

public getFailure() : Failure|null
Return values
Failure|null

getNextRetryDelay()

public getNextRetryDelay() : DateInterval|null
Return values
DateInterval|null

getOriginalMessage()

public getOriginalMessage() : string
Return values
string

getOriginalStackTrace()

public getOriginalStackTrace() : string|null
Return values
string|null

hasOriginalStackTrace()

public hasOriginalStackTrace() : bool
Tags
psalm-assert-if-true

non-empty-string $this->originalStackTrace

psalm-assert-if-false

null $this->originalStackTrace

Return values
bool

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>
Return values
string

        
On this page

Search results