Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
error_details.proto364 linesDownload Raw Back to rpc
1// Copyright 2026 Google LLC2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7//     http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14 15syntax = "proto3";16 17package google.rpc;18 19import "google/protobuf/duration.proto";20 21option go_package = "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails";22option java_multiple_files = true;23option java_outer_classname = "ErrorDetailsProto";24option java_package = "com.google.rpc";25option objc_class_prefix = "RPC";26 27// Describes the cause of the error with structured details.28//29// Example of an error when contacting the "pubsub.googleapis.com" API when it30// is not enabled:31//32//     { "reason": "API_DISABLED"33//       "domain": "googleapis.com"34//       "metadata": {35//         "resource": "projects/123",36//         "service": "pubsub.googleapis.com"37//       }38//     }39//40// This response indicates that the pubsub.googleapis.com API is not enabled.41//42// Example of an error that is returned when attempting to create a Spanner43// instance in a region that is out of stock:44//45//     { "reason": "STOCKOUT"46//       "domain": "spanner.googleapis.com",47//       "metadata": {48//         "availableRegions": "us-central1,us-east2"49//       }50//     }51message ErrorInfo {52  // The reason of the error. This is a constant value that identifies the53  // proximate cause of the error. Error reasons are unique within a particular54  // domain of errors. This should be at most 63 characters and match a55  // regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents56  // UPPER_SNAKE_CASE.57  string reason = 1;58 59  // The logical grouping to which the "reason" belongs. The error domain60  // is typically the registered service name of the tool or product that61  // generates the error. Example: "pubsub.googleapis.com". If the error is62  // generated by some common infrastructure, the error domain must be a63  // globally unique value that identifies the infrastructure. For Google API64  // infrastructure, the error domain is "googleapis.com".65  string domain = 2;66 67  // Additional structured details about this error.68  //69  // Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should70  // ideally be lowerCamelCase. Also, they must be limited to 64 characters in71  // length. When identifying the current value of an exceeded limit, the units72  // should be contained in the key, not the value.  For example, rather than73  // `{"instanceLimit": "100/request"}`, should be returned as,74  // `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of75  // instances that can be created in a single (batch) request.76  map<string, string> metadata = 3;77}78 79// Describes when the clients can retry a failed request. Clients could ignore80// the recommendation here or retry when this information is missing from error81// responses.82//83// It's always recommended that clients should use exponential backoff when84// retrying.85//86// Clients should wait until `retry_delay` amount of time has passed since87// receiving the error response before retrying.  If retrying requests also88// fail, clients should use an exponential backoff scheme to gradually increase89// the delay between retries based on `retry_delay`, until either a maximum90// number of retries have been reached or a maximum retry delay cap has been91// reached.92message RetryInfo {93  // Clients should wait at least this long between retrying the same request.94  google.protobuf.Duration retry_delay = 1;95}96 97// Describes additional debugging info.98message DebugInfo {99  // The stack trace entries indicating where the error occurred.100  repeated string stack_entries = 1;101 102  // Additional debugging information provided by the server.103  string detail = 2;104}105 106// Describes how a quota check failed.107//108// For example if a daily limit was exceeded for the calling project,109// a service could respond with a QuotaFailure detail containing the project110// id and the description of the quota limit that was exceeded.  If the111// calling project hasn't enabled the service in the developer console, then112// a service could respond with the project id and set `service_disabled`113// to true.114//115// Also see RetryInfo and Help types for other details about handling a116// quota failure.117message QuotaFailure {118  // A message type used to describe a single quota violation.  For example, a119  // daily quota or a custom quota that was exceeded.120  message Violation {121    // The subject on which the quota check failed.122    // For example, "clientip:<ip address of client>" or "project:<Google123    // developer project id>".124    string subject = 1;125 126    // A description of how the quota check failed. Clients can use this127    // description to find more about the quota configuration in the service's128    // public documentation, or find the relevant quota limit to adjust through129    // developer console.130    //131    // For example: "Service disabled" or "Daily Limit for read operations132    // exceeded".133    string description = 2;134 135    // The API Service from which the `QuotaFailure.Violation` orginates. In136    // some cases, Quota issues originate from an API Service other than the one137    // that was called. In other words, a dependency of the called API Service138    // could be the cause of the `QuotaFailure`, and this field would have the139    // dependency API service name.140    //141    // For example, if the called API is Kubernetes Engine API142    // (container.googleapis.com), and a quota violation occurs in the143    // Kubernetes Engine API itself, this field would be144    // "container.googleapis.com". On the other hand, if the quota violation145    // occurs when the Kubernetes Engine API creates VMs in the Compute Engine146    // API (compute.googleapis.com), this field would be147    // "compute.googleapis.com".148    string api_service = 3;149 150    // The metric of the violated quota. A quota metric is a named counter to151    // measure usage, such as API requests or CPUs. When an activity occurs in a152    // service, such as Virtual Machine allocation, one or more quota metrics153    // may be affected.154    //155    // For example, "compute.googleapis.com/cpus_per_vm_family",156    // "storage.googleapis.com/internet_egress_bandwidth".157    string quota_metric = 4;158 159    // The id of the violated quota. Also know as "limit name", this is the160    // unique identifier of a quota in the context of an API service.161    //162    // For example, "CPUS-PER-VM-FAMILY-per-project-region".163    string quota_id = 5;164 165    // The dimensions of the violated quota. Every non-global quota is enforced166    // on a set of dimensions. While quota metric defines what to count, the167    // dimensions specify for what aspects the counter should be increased.168    //169    // For example, the quota "CPUs per region per VM family" enforces a limit170    // on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions171    // "region" and "vm_family". And if the violation occurred in region172    // "us-central1" and for VM family "n1", the quota_dimensions would be,173    //174    // {175    //   "region": "us-central1",176    //   "vm_family": "n1",177    // }178    //179    // When a quota is enforced globally, the quota_dimensions would always be180    // empty.181    map<string, string> quota_dimensions = 6;182 183    // The enforced quota value at the time of the `QuotaFailure`.184    //185    // For example, if the enforced quota value at the time of the186    // `QuotaFailure` on the number of CPUs is "10", then the value of this187    // field would reflect this quantity.188    int64 quota_value = 7;189 190    // The new quota value being rolled out at the time of the violation. At the191    // completion of the rollout, this value will be enforced in place of192    // quota_value. If no rollout is in progress at the time of the violation,193    // this field is not set.194    //195    // For example, if at the time of the violation a rollout is in progress196    // changing the number of CPUs quota from 10 to 20, 20 would be the value of197    // this field.198    optional int64 future_quota_value = 8;199  }200 201  // Describes all quota violations.202  repeated Violation violations = 1;203}204 205// Describes what preconditions have failed.206//207// For example, if an RPC failed because it required the Terms of Service to be208// acknowledged, it could list the terms of service violation in the209// PreconditionFailure message.210message PreconditionFailure {211  // A message type used to describe a single precondition failure.212  message Violation {213    // The type of PreconditionFailure. We recommend using a service-specific214    // enum type to define the supported precondition violation subjects. For215    // example, "TOS" for "Terms of Service violation".216    string type = 1;217 218    // The subject, relative to the type, that failed.219    // For example, "google.com/cloud" relative to the "TOS" type would indicate220    // which terms of service is being referenced.221    string subject = 2;222 223    // A description of how the precondition failed. Developers can use this224    // description to understand how to fix the failure.225    //226    // For example: "Terms of service not accepted".227    string description = 3;228  }229 230  // Describes all precondition violations.231  repeated Violation violations = 1;232}233 234// Describes violations in a client request. This error type focuses on the235// syntactic aspects of the request.236message BadRequest {237  // A message type used to describe a single bad request field.238  message FieldViolation {239    // A path that leads to a field in the request body. The value will be a240    // sequence of dot-separated identifiers that identify a protocol buffer241    // field.242    //243    // Consider the following:244    //245    //     message CreateContactRequest {246    //       message EmailAddress {247    //         enum Type {248    //           TYPE_UNSPECIFIED = 0;249    //           HOME = 1;250    //           WORK = 2;251    //         }252    //253    //         optional string email = 1;254    //         repeated EmailType type = 2;255    //       }256    //257    //       string full_name = 1;258    //       repeated EmailAddress email_addresses = 2;259    //     }260    //261    // In this example, in proto `field` could take one of the following values:262    //263    // * `full_name` for a violation in the `full_name` value264    // * `email_addresses[0].email` for a violation in the `email` field of the265    //   first `email_addresses` message266    // * `email_addresses[2].type[1]` for a violation in the second `type`267    //   value in the third `email_addresses` message.268    //269    // In JSON, the same values are represented as:270    //271    // * `fullName` for a violation in the `fullName` value272    // * `emailAddresses[0].email` for a violation in the `email` field of the273    //   first `emailAddresses` message274    // * `emailAddresses[2].type[1]` for a violation in the second `type`275    //   value in the third `emailAddresses` message.276    string field = 1;277 278    // A description of why the request element is bad.279    string description = 2;280 281    // The reason of the field-level error. This is a constant value that282    // identifies the proximate cause of the field-level error. It should283    // uniquely identify the type of the FieldViolation within the scope of the284    // google.rpc.ErrorInfo.domain. This should be at most 63285    // characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,286    // which represents UPPER_SNAKE_CASE.287    string reason = 3;288 289    // Provides a localized error message for field-level errors that is safe to290    // return to the API consumer.291    LocalizedMessage localized_message = 4;292  }293 294  // Describes all violations in a client request.295  repeated FieldViolation field_violations = 1;296}297 298// Contains metadata about the request that clients can attach when filing a bug299// or providing other forms of feedback.300message RequestInfo {301  // An opaque string that should only be interpreted by the service generating302  // it. For example, it can be used to identify requests in the service's logs.303  string request_id = 1;304 305  // Any data that was used to serve this request. For example, an encrypted306  // stack trace that can be sent back to the service provider for debugging.307  string serving_data = 2;308}309 310// Describes the resource that is being accessed.311message ResourceInfo {312  // A name for the type of resource being accessed, e.g. "sql table",313  // "cloud storage bucket", "file", "Google calendar"; or the type URL314  // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".315  string resource_type = 1;316 317  // The name of the resource being accessed.  For example, a shared calendar318  // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current319  // error is320  // [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].321  string resource_name = 2;322 323  // The owner of the resource (optional).324  // For example, "user:<owner email>" or "project:<Google developer project325  // id>".326  string owner = 3;327 328  // Describes what error is encountered when accessing this resource.329  // For example, updating a cloud project may require the `writer` permission330  // on the developer console project.331  string description = 4;332}333 334// Provides links to documentation or for performing an out of band action.335//336// For example, if a quota check failed with an error indicating the calling337// project hasn't enabled the accessed service, this can contain a URL pointing338// directly to the right place in the developer console to flip the bit.339message Help {340  // Describes a URL link.341  message Link {342    // Describes what the link offers.343    string description = 1;344 345    // The URL of the link.346    string url = 2;347  }348 349  // URL(s) pointing to additional information on handling the current error.350  repeated Link links = 1;351}352 353// Provides a localized error message that is safe to return to the user354// which can be attached to an RPC error.355message LocalizedMessage {356  // The locale used following the specification defined at357  // https://www.rfc-editor.org/rfc/bcp/bcp47.txt.358  // Examples are: "en-US", "fr-CH", "es-MX"359  string locale = 1;360 361  // The localized error message in the above locale.362  string message = 2;363}364 
codekingpro/portable-devtools · Team Ai