Show / Hide Table of Contents

Class RpcException

Thrown when remote procedure call fails. Every RpcException is associated with a resulting Status of the call.

Inheritance
System.Object
System.Exception
RpcException
Implements
System.Runtime.Serialization.ISerializable
System.Runtime.InteropServices._Exception
Inherited Members
System.Exception.GetBaseException()
System.Exception.ToString()
System.Exception.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
System.Exception.GetType()
System.Exception.Message
System.Exception.Data
System.Exception.InnerException
System.Exception.TargetSite
System.Exception.StackTrace
System.Exception.HelpLink
System.Exception.Source
System.Exception.HResult
System.Exception.SerializeObjectState
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.MemberwiseClone()
Namespace: Grpc.Core
Assembly: Grpc.Core.Api.dll
Syntax
public class RpcException : Exception, ISerializable, _Exception

Constructors

RpcException(Status)

Creates a new RpcException associated with given status.

Declaration
public RpcException(Status status)
Parameters
Type Name Description
Status status

Resulting status of a call.

RpcException(Status, Metadata)

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

Declaration
public RpcException(Status status, Metadata trailers)
Parameters
Type Name Description
Status status

Resulting status of a call.

Metadata trailers

Response trailing metadata.

RpcException(Status, Metadata, String)

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

Declaration
public RpcException(Status status, Metadata trailers, string message)
Parameters
Type Name Description
Status status

Resulting status of a call.

Metadata trailers

Response trailing metadata.

System.String message

The exception message.

RpcException(Status, String)

Creates a new RpcException associated with given status and message.

Declaration
public RpcException(Status status, string message)
Parameters
Type Name Description
Status status

Resulting status of a call.

System.String message

The exception message.

Properties

Status

Resulting status of the call.

Declaration
public Status Status { get; }
Property Value
Type Description
Status

StatusCode

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

Declaration
public StatusCode StatusCode { get; }
Property Value
Type Description
StatusCode

Trailers

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.

Declaration
public Metadata Trailers { get; }
Property Value
Type Description
Metadata
Back to top