Show / Hide Table of Contents

Class Status

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details.

You can find out more about this error model and how to work with it in the API Design Guide.

Inheritance
System.Object
Status
Implements
IMessage<Status>
IMessage
System.IEquatable<Status>
IDeepCloneable<Status>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Rpc
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class Status : IMessage<Status>, IMessage, IEquatable<Status>, IDeepCloneable<Status>

Constructors

Status()

Declaration
public Status()

Status(Status)

Declaration
public Status(Status other)
Parameters
Type Name Description
Status other

Fields

CodeFieldNumber

Field number for the "code" field.

Declaration
public const int CodeFieldNumber = 1
Field Value
Type Description
System.Int32

DetailsFieldNumber

Field number for the "details" field.

Declaration
public const int DetailsFieldNumber = 3
Field Value
Type Description
System.Int32

MessageFieldNumber

Field number for the "message" field.

Declaration
public const int MessageFieldNumber = 2
Field Value
Type Description
System.Int32

Properties

Code

The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].

Declaration
public int Code { get; set; }
Property Value
Type Description
System.Int32

Descriptor

Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

Details

A list of messages that carry the error details. There is a common set of message types for APIs to use.

Declaration
public RepeatedField<Any> Details { get; }
Property Value
Type Description
RepeatedField<Any>

Message

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.

Declaration
public string Message { get; set; }
Property Value
Type Description
System.String

Parser

Declaration
public static MessageParser<Status> Parser { get; }
Property Value
Type Description
MessageParser<Status>

Methods

CalculateSize()

Declaration
public int CalculateSize()
Returns
Type Description
System.Int32
Implements
IMessage.CalculateSize()

Clone()

Declaration
public Status Clone()
Returns
Type Description
Status
Implements
IDeepCloneable<T>.Clone()

Equals(Status)

Declaration
public bool Equals(Status other)
Parameters
Type Name Description
Status other
Returns
Type Description
System.Boolean
Implements
System.IEquatable<T>.Equals(T)

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
System.Object other
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

MergeFrom(Status)

Declaration
public void MergeFrom(Status other)
Parameters
Type Name Description
Status other
Implements
IMessage<T>.MergeFrom(T)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor
Back to top