Table of Contents

Class HandlerException

Namespace
NexusRpc.Handlers
Assembly
NexusRpc.dll

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

errorType HandlerErrorType

Error type.

message string

Message.

errorRetryBehavior HandlerErrorRetryBehavior

Error 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

errorType HandlerErrorType

Error type.

message string

Message.

innerException Exception

Inner exception.

errorRetryBehavior HandlerErrorRetryBehavior

Error 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

rawErrorType string

Error type string.

message string

Message.

innerException Exception

Inner exception.

errorRetryBehavior HandlerErrorRetryBehavior

Error 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

HandlerErrorRetryBehavior

ErrorType

Gets the error type.

public HandlerErrorType ErrorType { get; }

Property Value

HandlerErrorType

IsRetryable

Gets a value indicating whether the error should be retried.

public bool IsRetryable { get; }

Property Value

bool

RawErrorType

Gets the raw error type as a string. Most users should use ErrorType.

public string RawErrorType { get; }

Property Value

string

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

errorTypeStr string

Raw error type string.

errorType HandlerErrorType

Error type to set.

Returns

bool

Whether it could be parsed.