public class RpcException : Exception, ISerializableThrown when remote procedure call fails. Every RpcException is associated with a resulting Status of the call.
Implements
ISerializableNamespace
Grpc.CoreAssembly
Grpc.Core.Api.dll
Constructors
RpcException(Status)
public RpcException(Status status)Creates a new RpcException associated with given status.
| Parameter | |
|---|---|
| Name | Description |
status | StatusResulting status of a call. |
RpcException(Status, Metadata)
public RpcException(Status status, Metadata trailers)Creates a new RpcException associated with given status and trailing response metadata.
| Parameters | |
|---|---|
| Name | Description |
status | StatusResulting status of a call. |
trailers | MetadataResponse trailing metadata. |
RpcException(Status, Metadata, string)
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.
| Parameters | |
|---|---|
| Name | Description |
status | StatusResulting status of a call. |
trailers | MetadataResponse trailing metadata. |
message | stringThe exception message. |
RpcException(Status, string)
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.
| Parameters | |
|---|---|
| Name | Description |
status | StatusResulting status of a call. |
message | stringThe exception message. |
Properties
Status
public Status Status { get; }Resulting status of the call.
| Property Value | |
|---|---|
| Type | Description |
Status | |
StatusCode
public StatusCode StatusCode { get; }Returns the status code of the call, as a convenient alternative to Status.StatusCode.
| Property Value | |
|---|---|
| Type | Description |
StatusCode | |
Trailers
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.
| Property Value | |
|---|---|
| Type | Description |
Metadata | |