<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />

Grpc.Core.RpcException

public class RpcException : Exception
Thrown when remote procedure call fails. Every RpcException is associated with a resulting Status of the call.
public Status Status { get; }

Resulting status of the call.

public StatusCode StatusCode { get; }

Returns the status code of the call, as a convenient alternative to StatusCodeStatus.StatusCode.

public Metadata Trailers { get; }

Gets the call trailing metadata. Trailers only have meaningful content for client-side calls (in which case they represent the trailing metadata sent by the server when closing the call). Instances of RpcException thrown by the server-side part of the stack will have trailers always set to empty.

public RpcException(Status status)

Creates a new RpcException associated with given status.

public RpcException(Status status, string message)

Creates a new RpcException associated with given status and message. NOTE: the exception message is not sent to the remote peer. Use status.Details to pass error details to the peer.

public RpcException(Status status, Metadata trailers)

Creates a new RpcException associated with given status and trailing response metadata.

public RpcException(Status status, Metadata trailers, string message)

Creates a new RpcException associated with given status, message and trailing response metadata. NOTE: the exception message is not sent to the remote peer. Use status.Details to pass error details to the peer.