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?, ApplicationErrorCategory)
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, ApplicationErrorCategory category = ApplicationErrorCategory.Unspecified)
Parameters
messagestringRequired message for the exception.
innerExceptionCause of the exception (can use other constructor if no cause).
errorTypestringOptional string type name of the exception.
nonRetryableboolIf true, marks the exception as non-retryable.
detailsIReadOnlyCollection<object>Collection of details to serialize into the exception.
nextRetryDelayTimeSpan?Override the next retry delay with this value.
categoryApplicationErrorCategoryError category.
ApplicationFailureException(string, string?, bool, IReadOnlyCollection<object?>?, TimeSpan?, ApplicationErrorCategory)
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, ApplicationErrorCategory category = ApplicationErrorCategory.Unspecified)
Parameters
messagestringRequired message for the exception.
errorTypestringOptional string type name of the exception.
nonRetryableboolIf true, marks the exception as non-retryable.
detailsIReadOnlyCollection<object>Collection of details to serialize into the exception.
nextRetryDelayTimeSpan?Override the next retry delay with this value.
categoryApplicationErrorCategoryError category.
ApplicationFailureException(Failure, Exception?, IPayloadConverter)
Initializes a new instance of the ApplicationFailureException class.
protected ApplicationFailureException(Failure failure, Exception? inner, IPayloadConverter converter)
Parameters
failureFailureUnderlying proto failure.
innerExceptionInner exception if any.
converterIPayloadConverterConverter used for converting details.
Properties
Category
Gets the error category.
public ApplicationErrorCategory Category { get; protected init; }
Property Value
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; }