Class HandlerException
Thrown from a handler for any unexpected error.
public class HandlerException : Exception, ISerializable
- Inheritance
-
HandlerException
- Implements
- Inherited Members
Constructors
HandlerException(HandlerErrorType, string, HandlerErrorRetryBehavior)
Initializes a new instance of the HandlerException class.
public HandlerException(HandlerErrorType errorType, string message, HandlerErrorRetryBehavior errorRetryBehavior = HandlerErrorRetryBehavior.Unspecified)
Parameters
errorTypeHandlerErrorTypeError type.
messagestringMessage.
errorRetryBehaviorHandlerErrorRetryBehaviorError retry behavior.
HandlerException(HandlerErrorType, string, Exception?, HandlerErrorRetryBehavior)
Initializes a new instance of the HandlerException class.
public HandlerException(HandlerErrorType errorType, string message, Exception? innerException, HandlerErrorRetryBehavior errorRetryBehavior = HandlerErrorRetryBehavior.Unspecified)
Parameters
errorTypeHandlerErrorTypeError type.
messagestringMessage.
innerExceptionExceptionInner exception.
errorRetryBehaviorHandlerErrorRetryBehaviorError retry behavior.
HandlerException(string, string, Exception?, HandlerErrorRetryBehavior)
Initializes a new instance of the HandlerException class.
public HandlerException(string rawErrorType, string message, Exception? innerException, HandlerErrorRetryBehavior errorRetryBehavior = HandlerErrorRetryBehavior.Unspecified)
Parameters
rawErrorTypestringError type string.
messagestringMessage.
innerExceptionExceptionInner exception.
errorRetryBehaviorHandlerErrorRetryBehaviorError retry behavior.
Remarks
This only exists for deserialization in case error types changes. Users should not use this constructor directly.
Properties
ErrorRetryBehavior
Gets the error retry behavior.
public HandlerErrorRetryBehavior ErrorRetryBehavior { get; }
Property Value
ErrorType
Gets the error type.
public HandlerErrorType ErrorType { get; }
Property Value
IsRetryable
Gets a value indicating whether the error should be retried.
public bool IsRetryable { get; }
Property Value
RawErrorType
Gets the raw error type as a string. Most users should use ErrorType.
public string RawErrorType { get; }
Property Value
Methods
TryParseErrorType(string, out HandlerErrorType)
Advanced helper to parse error type string into an error type.
public static bool TryParseErrorType(string errorTypeStr, out HandlerErrorType errorType)
Parameters
errorTypeStrstringRaw error type string.
errorTypeHandlerErrorTypeError type to set.
Returns
- bool
Whether it could be parsed.