Struct RpcErrorInfo
- Namespace
- DotBoxD.Services.Diagnostics
- Assembly
- DotBoxD.Services.dll
The error returned to a remote caller for a handler exception, produced by
ExceptionTransformer on the side that runs the service.
Message becomes the caller's RemoteServiceException message and
Type its remote error-type name (e.g. a value from RpcErrorTypes or a
custom application error code).
public readonly record struct RpcErrorInfo : IEquatable<RpcErrorInfo>
- Implements
- Inherited Members
Constructors
RpcErrorInfo(string, string)
The error returned to a remote caller for a handler exception, produced by
ExceptionTransformer on the side that runs the service.
Message becomes the caller's RemoteServiceException message and
Type its remote error-type name (e.g. a value from RpcErrorTypes or a
custom application error code).
public RpcErrorInfo(string Message, string Type)
Parameters
Properties
Message
public string Message { get; init; }
Property Value
Type
public string Type { get; init; }
Property Value
Methods
FromException(Exception)
Builds an 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)
Parameters
exceptionException