Reference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::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: { "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" } }
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#domain
defdomain()->::String
Returns
(::String) — 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".
#domain=
defdomain=(value)->::String
Parameter
value (::String) — 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".
Returns
(::String) — 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".
(::Google::Protobuf::Map{::String => ::String}) — Additional structured details about this error. Keys must match a regular expression of a-z+ but should ideally be lowerCamelCase. Also, they must 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.
value (::Google::Protobuf::Map{::String => ::String}) — Additional structured details about this error. Keys must match a regular expression of a-z+ but should ideally be lowerCamelCase. Also, they must 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.
Returns
(::Google::Protobuf::Map{::String => ::String}) — Additional structured details about this error. Keys must match a regular expression of a-z+ but should ideally be lowerCamelCase. Also, they must 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.
#reason
defreason()->::String
Returns
(::String) — 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.
#reason=
defreason=(value)->::String
Parameter
value (::String) — 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.
Returns
(::String) — 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Google Cloud Compute V1 API - Class Google::Cloud::Compute::V1::ErrorInfo (v3.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.0.0 (latest)](/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.22.0](/ruby/docs/reference/google-cloud-compute-v1/2.22.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.21.1](/ruby/docs/reference/google-cloud-compute-v1/2.21.1/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.20.0](/ruby/docs/reference/google-cloud-compute-v1/2.20.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.19.1](/ruby/docs/reference/google-cloud-compute-v1/2.19.1/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.18.0](/ruby/docs/reference/google-cloud-compute-v1/2.18.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.17.0](/ruby/docs/reference/google-cloud-compute-v1/2.17.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.16.0](/ruby/docs/reference/google-cloud-compute-v1/2.16.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.15.0](/ruby/docs/reference/google-cloud-compute-v1/2.15.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.14.0](/ruby/docs/reference/google-cloud-compute-v1/2.14.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.13.0](/ruby/docs/reference/google-cloud-compute-v1/2.13.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.12.0](/ruby/docs/reference/google-cloud-compute-v1/2.12.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.11.0](/ruby/docs/reference/google-cloud-compute-v1/2.11.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.10.0](/ruby/docs/reference/google-cloud-compute-v1/2.10.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.9.0](/ruby/docs/reference/google-cloud-compute-v1/2.9.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.8.0](/ruby/docs/reference/google-cloud-compute-v1/2.8.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.7.2](/ruby/docs/reference/google-cloud-compute-v1/2.7.2/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.6.0](/ruby/docs/reference/google-cloud-compute-v1/2.6.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.5.0](/ruby/docs/reference/google-cloud-compute-v1/2.5.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.4.0](/ruby/docs/reference/google-cloud-compute-v1/2.4.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.3.0](/ruby/docs/reference/google-cloud-compute-v1/2.3.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.2.0](/ruby/docs/reference/google-cloud-compute-v1/2.2.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.1.0](/ruby/docs/reference/google-cloud-compute-v1/2.1.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [2.0.0](/ruby/docs/reference/google-cloud-compute-v1/2.0.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.10.0](/ruby/docs/reference/google-cloud-compute-v1/1.10.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.9.0](/ruby/docs/reference/google-cloud-compute-v1/1.9.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.8.0](/ruby/docs/reference/google-cloud-compute-v1/1.8.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.7.1](/ruby/docs/reference/google-cloud-compute-v1/1.7.1/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.6.0](/ruby/docs/reference/google-cloud-compute-v1/1.6.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.5.0](/ruby/docs/reference/google-cloud-compute-v1/1.5.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.4.0](/ruby/docs/reference/google-cloud-compute-v1/1.4.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.3.0](/ruby/docs/reference/google-cloud-compute-v1/1.3.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.2.0](/ruby/docs/reference/google-cloud-compute-v1/1.2.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.1.0](/ruby/docs/reference/google-cloud-compute-v1/1.1.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [1.0.0](/ruby/docs/reference/google-cloud-compute-v1/1.0.0/Google-Cloud-Compute-V1-ErrorInfo)\n- [0.5.0](/ruby/docs/reference/google-cloud-compute-v1/0.5.0/Google-Cloud-Compute-V1-ErrorInfo) \nReference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::ErrorInfo.\n\nDescribes 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\" } } \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #domain\n\n def domain() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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\".\n\n### #domain=\n\n def domain=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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\". \n**Returns**\n\n- (::String) --- 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\".\n\n### #metadatas\n\n def metadatas() -\u003e ::Google::Protobuf::Map{::String =\u003e ::String}\n\n**Returns**\n\n- (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Additional structured details about this error. Keys must match a regular expression of `a-z+` but should ideally be lowerCamelCase. Also, they must 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.\n\n### #metadatas=\n\n def metadatas=(value) -\u003e ::Google::Protobuf::Map{::String =\u003e ::String}\n\n**Parameter**\n\n- **value** (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Additional structured details about this error. Keys must match a regular expression of `a-z+` but should ideally be lowerCamelCase. Also, they must 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. \n**Returns**\n\n- (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Additional structured details about this error. Keys must match a regular expression of `a-z+` but should ideally be lowerCamelCase. Also, they must 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.\n\n### #reason\n\n def reason() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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.\n\n### #reason=\n\n def reason=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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. \n**Returns**\n\n- (::String) --- 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."]]