Show / Hide Table of Contents

Class ErrorInfo

Describes the cause of the error with structured details.

Example of an error when contacting the "pubsub.googleapis.com" API when it is not enabled: { "type": "API_DISABLED" "domain": "googleapis.com" "metadata": { "resource": "projects/123", "service": "pubsub.googleapis.com" } } This response indicates that the pubsub.googleapis.com API is not enabled.

Example of an error that is returned when attempting to create a Spanner instance in a region that is out of stock: { "type": "STOCKOUT" "domain": "spanner.googleapis.com", "metadata": { "availableRegions": ""us-central1,us-east2" } }

Inheritance
System.Object
ErrorInfo
Implements
IMessage<ErrorInfo>
IMessage
System.IEquatable<ErrorInfo>
IDeepCloneable<ErrorInfo>
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 ErrorInfo : IMessage<ErrorInfo>, IMessage, IEquatable<ErrorInfo>, IDeepCloneable<ErrorInfo>

Constructors

ErrorInfo()

Declaration
public ErrorInfo()

ErrorInfo(ErrorInfo)

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

Fields

DomainFieldNumber

Field number for the "domain" field.

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

MetadataFieldNumber

Field number for the "metadata" field.

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

TypeFieldNumber

Field number for the "type" field.

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

Properties

Descriptor

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

Domain

The logical grouping to which the "type" belongs. Often "domain" will contain the registered service name of the tool or product that is the source of the error. Example: "pubsub.googleapis.com". If the error is common across many APIs, the first segment of the example above will be omitted. The value will be, "googleapis.com".

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

Metadata

Additional structured details about this error.

Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

Declaration
public MapField<string, string> Metadata { get; }
Property Value
Type Description
MapField<System.String, System.String>

Parser

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

Type

The type of the error. This is a constant value that identifies the proximate cause of the error. Error types are unique within a particular source of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.

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

Methods

CalculateSize()

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

Clone()

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

Equals(ErrorInfo)

Declaration
public bool Equals(ErrorInfo other)
Parameters
Type Name Description
ErrorInfo 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(ErrorInfo)

Declaration
public void MergeFrom(ErrorInfo other)
Parameters
Type Name Description
ErrorInfo 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