error_details.proto 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // Copyright (c) 2015, Google Inc.
  2. //
  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 at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // 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 and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.rpc;
  16. import "google/protobuf/duration.proto";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "ErrorDetailsProto";
  19. option java_package = "com.google.rpc";
  20. // Describes when the clients can retry a failed request. Clients could ignore
  21. // the recommendation here or retry when this information is missing from error
  22. // responses.
  23. //
  24. // It's always recommended that clients should use exponential backoff when
  25. // retrying.
  26. //
  27. // Clients should wait until `retry_delay` amount of time has passed since
  28. // receiving the error response before retrying. If retrying requests also
  29. // fail, clients should use an exponential backoff scheme to gradually increase
  30. // the delay between retries based on `retry_delay`, until either a maximum
  31. // number of retires have been reached or a maximum retry delay cap has been
  32. // reached.
  33. message RetryInfo {
  34. // Clients should wait at least this long between retrying the same request.
  35. google.protobuf.Duration retry_delay = 1;
  36. }
  37. // Describes additional debugging info.
  38. message DebugInfo {
  39. // The stack trace entries indicating where the error occurred.
  40. repeated string stack_entries = 1;
  41. // Additional debugging information provided by the server.
  42. string detail = 2;
  43. }
  44. // Describes how a quota check failed.
  45. //
  46. // For example if a daily limit was exceeded for the calling project,
  47. // a service could respond with a QuotaFailure detail containing the project
  48. // id and the description of the quota limit that was exceeded. If the
  49. // calling project hasn't enabled the service in the developer console, then
  50. // a service could respond with the project id and set `service_disabled`
  51. // to true.
  52. //
  53. // Also see RetryDetail and Help types for other details about handling a
  54. // quota failure.
  55. message QuotaFailure {
  56. // A message type used to describe a single quota violation. For example, a
  57. // daily quota or a custom quota that was exceeded.
  58. message Violation {
  59. // The subject on which the quota check failed.
  60. // For example, "clientip:<ip address of client>" or "project:<Google
  61. // developer project id>".
  62. string subject = 1;
  63. // A description of how the quota check failed. Clients can use this
  64. // description to find more about the quota configuration in the service's
  65. // public documentation, or find the relevant quota limit to adjust through
  66. // developer console.
  67. //
  68. // For example: "Service disabled" or "Daily Limit for read operations
  69. // exceeded".
  70. string description = 2;
  71. }
  72. // Describes all quota violations.
  73. repeated Violation violations = 1;
  74. }
  75. // Describes violations in a client request. This error type focuses on the
  76. // syntactic aspects of the request.
  77. message BadRequest {
  78. // A message type used to describe a single bad request field.
  79. message FieldViolation {
  80. // A path leading to a field in the request body. The value will be a
  81. // sequence of dot-separated identifiers that identify a protocol buffer
  82. // field. E.g., "violations.field" would identify this field.
  83. string field = 1;
  84. // A description of why the request element is bad.
  85. string description = 2;
  86. }
  87. // Describes all violations in a client request.
  88. repeated FieldViolation field_violations = 1;
  89. }
  90. // Contains metadata about the request that clients can attach when filing a bug
  91. // or providing other forms of feedback.
  92. message RequestInfo {
  93. // An opaque string that should only be interpreted by the service generating
  94. // it. For example, it can be used to identify requests in the service's logs.
  95. string request_id = 1;
  96. // Any data that was used to serve this request. For example, an encrypted
  97. // stack trace that can be sent back to the service provider for debugging.
  98. string serving_data = 2;
  99. }
  100. // Describes the resource that is being accessed.
  101. message ResourceInfo {
  102. // A name for the type of resource being accessed, e.g. "sql table",
  103. // "cloud storage bucket", "file", "Google calendar"; or the type URL
  104. // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
  105. string resource_type = 1;
  106. // The name of the resource being accessed. For example, a shared calendar
  107. // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
  108. // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
  109. string resource_name = 2;
  110. // The owner of the resource (optional).
  111. // For example, "user:<owner email>" or "project:<Google developer project
  112. // id>".
  113. string owner = 3;
  114. // Describes what error is encountered when accessing this resource.
  115. // For example, updating a cloud project may require the `writer` permission
  116. // on the developer console project.
  117. string description = 4;
  118. }
  119. // Provides links to documentation or for performing an out of band action.
  120. //
  121. // For example, if a quota check failed with an error indicating the calling
  122. // project hasn't enabled the accessed service, this can contain a URL pointing
  123. // directly to the right place in the developer console to flip the bit.
  124. message Help {
  125. // Describes a URL link.
  126. message Link {
  127. // Describes what the link offers.
  128. string description = 1;
  129. // The URL of the link.
  130. string url = 2;
  131. }
  132. // URL(s) pointing to additional information on handling the current error.
  133. repeated Link links = 1;
  134. }