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

Grpc.Core.Status

public struct Status
Represents RPC result, which consists of StatusCode and an optional detail string.
public static readonly Status DefaultCancelled

Default result of a cancelled RPC. StatusCode=Cancelled, empty details message.

public static readonly Status DefaultSuccess

Default result of a successful RPC. StatusCode=OK, empty details message.

public Exception DebugException { get; }

In case of an error, this field may contain additional error details to help with debugging. This field will be only populated on a client and its value is generated locally, based on the internal state of the gRPC client stack (i.e. the value is never sent over the wire). Note that this field is available only for debugging purposes, the application logic should never rely on values of this field (it should use StatusCode and Detail instead). Example: when a client fails to connect to a server, this field may provide additional details why the connection to the server has failed. Note: experimental API that can change or be removed without any prior notice.

public string Detail { get; }

Gets the detail.

public StatusCode StatusCode { get; }

Gets the gRPC status code. OK indicates success, all other values indicate an error.

public Status(StatusCode statusCode, string detail)

Creates a new instance of Status.

public Status(StatusCode statusCode, string detail, Exception debugException)

Creates a new instance of Status. Users should not use this constructor, except for creating instances for testing. The debug error string should only be populated by gRPC internals. Note: experimental API that can change or be removed without any prior notice.