Skip to content

Struct RpcErrorInfo

Namespace: DotBoxD.Services.Diagnostics
Assembly: DotBoxD.Services.dll

The error returned to a remote caller for a handler exception, produced by DotBoxD.Services.Peer.RpcPeerOptions.ExceptionTransformer on the side that runs the service. DotBoxD.Services.Diagnostics.RpcErrorInfo.Message becomes the caller’s RemoteServiceException message and DotBoxD.Services.Diagnostics.RpcErrorInfo.Type its remote error-type name (e.g. a value from DotBoxD.Services.Diagnostics.RpcErrorTypes or a custom application error code).

public readonly record struct RpcErrorInfo : IEquatable<RpcErrorInfo>

IEquatable<RpcErrorInfo>

object.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object, object), object.ToString()

The error returned to a remote caller for a handler exception, produced by DotBoxD.Services.Peer.RpcPeerOptions.ExceptionTransformer on the side that runs the service. DotBoxD.Services.Diagnostics.RpcErrorInfo.Message becomes the caller’s RemoteServiceException message and DotBoxD.Services.Diagnostics.RpcErrorInfo.Type its remote error-type name (e.g. a value from DotBoxD.Services.Diagnostics.RpcErrorTypes or a custom application error code).

public RpcErrorInfo(string Message, string Type)

Message string

Type string

public string Message { get; init; }

string

public string Type { get; init; }

string

Builds an DotBoxD.Services.Diagnostics.RpcErrorInfo that exposes the exception’s message and runtime type name — the “expose everything” shortcut for a transformer. Prefer a tailored transformer that returns safe, caller-facing messages: exception text can carry sensitive detail (file paths, connection strings), so only expose it to trusted peers.

public static RpcErrorInfo FromException(Exception exception)

exception Exception

RpcErrorInfo