Class ApplicationFailureException
- Namespace
- Temporalio.Exceptions
- Assembly
- Temporalio.dll
Exception representing an error in user code.
public class ApplicationFailureException : FailureException, ISerializable
- Inheritance
-
ApplicationFailureException
- Implements
- Inherited Members
Remarks
For workflows, users should throw this exception to signal a workflow failure. Other non-Temporal exceptions will not fail the workflow.
In activities, all non-Temporal exceptions are translated to this exception as retryable with the Type as the unqualified exception class name.
Constructors
ApplicationFailureException(string, Exception?, string?, bool, IReadOnlyCollection<object?>?, TimeSpan?)
Initializes a new instance of the ApplicationFailureException class.
public ApplicationFailureException(string message, Exception? inner, string? errorType = null, bool nonRetryable = false, IReadOnlyCollection<object?>? details = null, TimeSpan? nextRetryDelay = null)
Parameters
message
stringRequired message for the exception.
inner
ExceptionCause of the exception (can use other constructor if no cause).
errorType
stringOptional string type name of the exception.
nonRetryable
boolIf true, marks the exception as non-retryable.
details
IReadOnlyCollection<object>Collection of details to serialize into the exception.
nextRetryDelay
TimeSpan?Override the next retry delay with this value.
ApplicationFailureException(string, string?, bool, IReadOnlyCollection<object?>?, TimeSpan?)
Initializes a new instance of the ApplicationFailureException class.
public ApplicationFailureException(string message, string? errorType = null, bool nonRetryable = false, IReadOnlyCollection<object?>? details = null, TimeSpan? nextRetryDelay = null)
Parameters
message
stringRequired message for the exception.
errorType
stringOptional string type name of the exception.
nonRetryable
boolIf true, marks the exception as non-retryable.
details
IReadOnlyCollection<object>Collection of details to serialize into the exception.
nextRetryDelay
TimeSpan?Override the next retry delay with this value.
ApplicationFailureException(Failure, Exception?, IPayloadConverter)
Initializes a new instance of the ApplicationFailureException class.
protected ApplicationFailureException(Failure failure, Exception? inner, IPayloadConverter converter)
Parameters
failure
FailureUnderlying proto failure.
inner
ExceptionInner exception if any.
converter
IPayloadConverterConverter used for converting details.
Properties
Details
Gets the details of the exception. This is never null.
public IFailureDetails Details { get; protected init; }
Property Value
Remarks
This will be OutboundFailureDetails for user-created exceptions and InboundFailureDetails for server-serialized exceptions.
ErrorType
Gets the string "type" of the exception if any.
public string? ErrorType { get; protected init; }
Property Value
NextRetryDelay
Gets the next retry delay override if any was set.
public TimeSpan? NextRetryDelay { get; protected init; }
Property Value
NonRetryable
Gets a value indicating whether this exception is non-retryable.
public bool NonRetryable { get; protected init; }