public static final class ErrorInfo.Builder extends GeneratedMessageV3.Builder<ErrorInfo.Builder> 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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public ErrorInfo.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
buildPartial()
public ErrorInfo buildPartial()
clear()
public ErrorInfo.Builder clear()
Overrides
clearDomain()
public ErrorInfo.Builder clearDomain()
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;
clearField(Descriptors.FieldDescriptor field)
public ErrorInfo.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
public ErrorInfo.Builder clearMetadata()
clearOneof(Descriptors.OneofDescriptor oneof)
public ErrorInfo.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearReason()
public ErrorInfo.Builder clearReason()
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
regular expression of A-Z+[A-Z0-9]
, which represents
UPPER_SNAKE_CASE.
string reason = 1;
clone()
public ErrorInfo.Builder clone()
Overrides
public 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;
Parameter |
---|
Name | Description |
key | String
|
getDefaultInstanceForType()
public ErrorInfo getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getDomain()
public 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;
Returns |
---|
Type | Description |
String | The domain.
|
getDomainBytes()
public 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;
Returns |
---|
Type | Description |
ByteString | The bytes for domain.
|
public Map<String,String> getMetadata()
public int getMetadataCount()
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;
Returns |
---|
Type | Description |
int | |
public 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;
public 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;
public 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;
Parameter |
---|
Name | Description |
key | String
|
public Map<String,String> getMutableMetadata()
Use alternate mutation accessors instead.
getReason()
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
regular expression of A-Z+[A-Z0-9]
, which represents
UPPER_SNAKE_CASE.
string reason = 1;
Returns |
---|
Type | Description |
String | The reason.
|
getReasonBytes()
public 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
regular expression of A-Z+[A-Z0-9]
, which represents
UPPER_SNAKE_CASE.
string reason = 1;
Returns |
---|
Type | Description |
ByteString | The bytes for reason.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter |
---|
Name | Description |
number | int
|
Overrides
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Parameter |
---|
Name | Description |
number | int
|
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
public ErrorInfo.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public ErrorInfo.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeFrom(ErrorInfo other)
public ErrorInfo.Builder mergeFrom(ErrorInfo other)
mergeUnknownFields(UnknownFieldSet unknownFields)
public final ErrorInfo.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
public ErrorInfo.Builder putAllMetadata(Map<String,String> values)
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;
public ErrorInfo.Builder putMetadata(String key, String value)
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;
public ErrorInfo.Builder removeMetadata(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;
Parameter |
---|
Name | Description |
key | String
|
setDomain(String value)
public ErrorInfo.Builder setDomain(String value)
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;
Parameter |
---|
Name | Description |
value | String
The domain to set.
|
setDomainBytes(ByteString value)
public ErrorInfo.Builder setDomainBytes(ByteString value)
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;
Parameter |
---|
Name | Description |
value | ByteString
The bytes for domain to set.
|
setField(Descriptors.FieldDescriptor field, Object value)
public ErrorInfo.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setReason(String value)
public ErrorInfo.Builder setReason(String value)
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
regular expression of A-Z+[A-Z0-9]
, which represents
UPPER_SNAKE_CASE.
string reason = 1;
Parameter |
---|
Name | Description |
value | String
The reason to set.
|
setReasonBytes(ByteString value)
public ErrorInfo.Builder setReasonBytes(ByteString value)
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
regular expression of A-Z+[A-Z0-9]
, which represents
UPPER_SNAKE_CASE.
string reason = 1;
Parameter |
---|
Name | Description |
value | ByteString
The bytes for reason to set.
|
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public ErrorInfo.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final ErrorInfo.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides