public final class ErrorInfo extends com.google.protobuf.GeneratedMessageV3 implements ErrorInfoOrBuilder
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:
{ "reason": "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:
{ "reason": "STOCKOUT"
"domain": "spanner.googleapis.com",
"metadata": {
"availableRegions": "us-central1,us-east2"
}
}
Protobuf type google.rpc.ErrorInfo| Modifier and Type | Class and Description |
|---|---|
static class |
ErrorInfo.Builder
Describes the cause of the error with structured details.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
DOMAIN_FIELD_NUMBER |
static int |
METADATA_FIELD_NUMBER |
static int |
REASON_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsMetadata(String key)
Additional structured details about this error.
|
boolean |
equals(Object obj) |
static ErrorInfo |
getDefaultInstance() |
ErrorInfo |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
String |
getDomain()
The logical grouping to which the "reason" belongs.
|
com.google.protobuf.ByteString |
getDomainBytes()
The logical grouping to which the "reason" belongs.
|
Map<String,String> |
getMetadata()
Deprecated.
|
int |
getMetadataCount()
Additional structured details about this error.
|
Map<String,String> |
getMetadataMap()
Additional structured details about this error.
|
String |
getMetadataOrDefault(String key,
String defaultValue)
Additional structured details about this error.
|
String |
getMetadataOrThrow(String key)
Additional structured details about this error.
|
com.google.protobuf.Parser<ErrorInfo> |
getParserForType() |
String |
getReason()
The reason of the error.
|
com.google.protobuf.ByteString |
getReasonBytes()
The reason of the error.
|
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapField |
internalGetMapField(int number) |
boolean |
isInitialized() |
static ErrorInfo.Builder |
newBuilder() |
static ErrorInfo.Builder |
newBuilder(ErrorInfo prototype) |
ErrorInfo.Builder |
newBuilderForType() |
protected ErrorInfo.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static ErrorInfo |
parseDelimitedFrom(InputStream input) |
static ErrorInfo |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorInfo |
parseFrom(byte[] data) |
static ErrorInfo |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorInfo |
parseFrom(ByteBuffer data) |
static ErrorInfo |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorInfo |
parseFrom(com.google.protobuf.ByteString data) |
static ErrorInfo |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorInfo |
parseFrom(com.google.protobuf.CodedInputStream input) |
static ErrorInfo |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorInfo |
parseFrom(InputStream input) |
static ErrorInfo |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<ErrorInfo> |
parser() |
ErrorInfo.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int REASON_FIELD_NUMBER
public static final int DOMAIN_FIELD_NUMBER
public static final int METADATA_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapField internalGetMapField(int number)
internalGetMapField in class com.google.protobuf.GeneratedMessageV3protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public String getReason()
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.
string reason = 1;getReason in interface ErrorInfoOrBuilderpublic com.google.protobuf.ByteString getReasonBytes()
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match /[A-Z0-9_]+/.
string reason = 1;getReasonBytes in interface ErrorInfoOrBuilderpublic String getDomain()
The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".
string domain = 2;getDomain in interface ErrorInfoOrBuilderpublic com.google.protobuf.ByteString getDomainBytes()
The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".
string domain = 2;getDomainBytes in interface ErrorInfoOrBuilderpublic int getMetadataCount()
ErrorInfoOrBuilder
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.
map<string, string> metadata = 3;getMetadataCount in interface ErrorInfoOrBuilderpublic boolean containsMetadata(String key)
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.
map<string, string> metadata = 3;containsMetadata in interface ErrorInfoOrBuilder@Deprecated public Map<String,String> getMetadata()
getMetadataMap() instead.getMetadata in interface ErrorInfoOrBuilderpublic Map<String,String> getMetadataMap()
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.
map<string, string> metadata = 3;getMetadataMap in interface ErrorInfoOrBuilderpublic String getMetadataOrDefault(String key, String defaultValue)
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.
map<string, string> metadata = 3;getMetadataOrDefault in interface ErrorInfoOrBuilderpublic String getMetadataOrThrow(String key)
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.
map<string, string> metadata = 3;getMetadataOrThrow in interface ErrorInfoOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static ErrorInfo parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorInfo parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorInfo parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorInfo parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorInfo parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorInfo parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorInfo parseFrom(InputStream input) throws IOException
IOExceptionpublic static ErrorInfo parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ErrorInfo parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static ErrorInfo parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ErrorInfo parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static ErrorInfo parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic ErrorInfo.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static ErrorInfo.Builder newBuilder()
public static ErrorInfo.Builder newBuilder(ErrorInfo prototype)
public ErrorInfo.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected ErrorInfo.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static ErrorInfo getDefaultInstance()
public static com.google.protobuf.Parser<ErrorInfo> parser()
public com.google.protobuf.Parser<ErrorInfo> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public ErrorInfo getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2022 Google LLC. All rights reserved.