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| 限定符和类型 | 类和说明 |
|---|---|
static class |
ErrorInfo.Builder
Describes the cause of the error with structured details.
|
com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DOMAIN_FIELD_NUMBER |
static int |
METADATA_FIELD_NUMBER |
static int |
REASON_FIELD_NUMBER |
| 限定符和类型 | 方法和说明 |
|---|---|
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()
已过时。
|
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() |
int |
hashCode() |
boolean |
isInitialized() |
static ErrorInfo.Builder |
newBuilder() |
static ErrorInfo.Builder |
newBuilder(ErrorInfo prototype) |
ErrorInfo.Builder |
newBuilderForType() |
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) |
getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneoffindInitializationErrors, getInitializationErrorString, toStringtoByteArray, toByteString, writeDelimitedTo, writeTopublic static final int REASON_FIELD_NUMBER
public static final int DOMAIN_FIELD_NUMBER
public static final int METADATA_FIELD_NUMBER
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
public 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 在接口中 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 在接口中 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 在接口中 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 在接口中 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 在接口中 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 在接口中 ErrorInfoOrBuilder@Deprecated public Map<String,String> getMetadata()
getMetadataMap() instead.getMetadata 在接口中 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 在接口中 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 在接口中 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 在接口中 ErrorInfoOrBuilderpublic final boolean isInitialized()
isInitialized 在接口中 com.google.protobuf.MessageLiteOrBuilderisInitialized 在类中 com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo 在接口中 com.google.protobuf.MessageLitewriteTo 在类中 com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize 在接口中 com.google.protobuf.MessageLitegetSerializedSize 在类中 com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals 在接口中 com.google.protobuf.Messageequals 在类中 com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode 在接口中 com.google.protobuf.MessagehashCode 在类中 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 在接口中 com.google.protobuf.MessagenewBuilderForType 在接口中 com.google.protobuf.MessageLitepublic static ErrorInfo.Builder newBuilder()
public static ErrorInfo.Builder newBuilder(ErrorInfo prototype)
public ErrorInfo.Builder toBuilder()
toBuilder 在接口中 com.google.protobuf.MessagetoBuilder 在接口中 com.google.protobuf.MessageLitepublic static ErrorInfo getDefaultInstance()
public static com.google.protobuf.Parser<ErrorInfo> parser()
public com.google.protobuf.Parser<ErrorInfo> getParserForType()
getParserForType 在接口中 com.google.protobuf.MessagegetParserForType 在接口中 com.google.protobuf.MessageLitegetParserForType 在类中 com.google.protobuf.GeneratedMessageV3public ErrorInfo getDefaultInstanceForType()
getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilderCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.