Table of Contents

Class DispatchException

Namespace
IceRpc
Assembly
IceRpc.dll

Represents an exception thrown while dispatching a request. It's encoded as a response with a status code greater than Ok.

public sealed class DispatchException : Exception, ISerializable
Inheritance
DispatchException
Implements
Inherited Members

Constructors

DispatchException(StatusCode, string?, Exception?)

Constructs a new instance of DispatchException.

public DispatchException(StatusCode statusCode, string? message = null, Exception? innerException = null)

Parameters

statusCode StatusCode

The status code of this exception. It must be greater than Ok.

message string

A message that describes the exception.

innerException Exception

The exception that is the cause of the current exception.

Exceptions

ArgumentOutOfRangeException

Thrown if statusCode is equal to Ok.

Properties

ConvertToInternalError

Gets or sets a value indicating whether the exception should be converted into a DispatchException with status code InternalError when thrown from a dispatch.

public bool ConvertToInternalError { get; set; }

Property Value

bool

When true, this exception is converted into dispatch exception with status code InternalError just before it's encoded. Defaults to true for an exception decoded from an IncomingResponse, and false for an exception created by the application using a constructor of DispatchException.

StatusCode

Gets the status code.

public StatusCode StatusCode { get; }

Property Value

StatusCode

The StatusCode of this exception.