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
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class ErrorInfo : IMessage<ErrorInfo>, IMessage, IEquatable<ErrorInfo>, IDeepCloneable<ErrorInfo>
Constructors
ErrorInfo()
Declaration
ErrorInfo(ErrorInfo)
Declaration
public ErrorInfo(ErrorInfo other)
Parameters
Fields
DomainFieldNumber
Field number for the "domain" field.
Declaration
public const int DomainFieldNumber = 2
Field Value
Type |
Description |
System.Int32 |
|
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
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 |
|
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
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
Clone()
Declaration
Returns
Implements
Equals(ErrorInfo)
Declaration
public bool Equals(ErrorInfo other)
Parameters
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()
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
MergeFrom(ErrorInfo)
Declaration
public void MergeFrom(ErrorInfo other)
Parameters
Implements
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
WriteTo(CodedOutputStream)
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Implements
Explicit Interface Implementations
IMessage.Descriptor
Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Implements