Table of Contents

Class RemoteInvocationException

Namespace
StreamJsonRpc
Assembly
StreamJsonRpc.dll

Remote RPC exception that indicates that the server target method threw an exception.

[Serializable]
public class RemoteInvocationException : RemoteRpcException, ISerializable
Inheritance
RemoteInvocationException
Implements
Inherited Members

Remarks

The details of the target method exception can be found on the ErrorCode and ErrorData properties.

Constructors

RemoteInvocationException(SerializationInfo, StreamingContext)

Initializes a new instance of the RemoteInvocationException class.

protected RemoteInvocationException(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

Serialization info.

context StreamingContext

Streaming context.

RemoteInvocationException(string?, int, Exception)

Initializes a new instance of the RemoteInvocationException class.

public RemoteInvocationException(string? message, int errorCode, Exception innerException)

Parameters

message string

The message.

errorCode int

The value of the error.code field in the response.

innerException Exception

The deserialized exception thrown by the RPC server.

RemoteInvocationException(string?, int, object?)

Initializes a new instance of the RemoteInvocationException class.

public RemoteInvocationException(string? message, int errorCode, object? errorData)

Parameters

message string

The message.

errorCode int

The value of the error.code field in the response.

errorData object

The value of the error.data field in the response.

RemoteInvocationException(string?, int, object?, object?)

Initializes a new instance of the RemoteInvocationException class.

public RemoteInvocationException(string? message, int errorCode, object? errorData, object? deserializedErrorData)

Parameters

message string

The message.

errorCode int

The value of the error.code field in the response.

errorData object

The value of the error.data field in the response.

deserializedErrorData object

The value of the error.data field in the response, deserialized according to GetErrorDetailsDataType(JsonRpcError).

Properties

DeserializedErrorData

Gets or sets the error.data value in the error response, if one was provided.

public object? DeserializedErrorData { get; }

Property Value

object

Remarks

The type of this object is determined by GetErrorDetailsDataType(JsonRpcError). The default implementation of this method produces a CommonErrorData object.

ErrorCode

Gets the value of the error.code field in the response.

public int ErrorCode { get; }

Property Value

int

The value may be any integer. The value may be InvocationError, which is a general value used for exceptions thrown on the server when the server does not give an app-specific error code.

ErrorData

Gets or sets the error.data value in the error response, if one was provided.

public object? ErrorData { get; }

Property Value

object

Remarks

Depending on the IJsonRpcMessageFormatter used, the value of this property, if any, may be a Newtonsoft.Json.Linq.JToken or a deserialized object. If a deserialized object, the type of this object is determined by GetErrorDetailsDataType(JsonRpcError). The default implementation of this method produces a CommonErrorData object.

Methods

ToString()

public override string ToString()

Returns

string