codekingpro/portable-devtools
115k
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 19option go_package = "google.golang.org/genproto/googleapis/rpc/code;code";20option java_multiple_files = true;21option java_outer_classname = "CodeProto";22option java_package = "com.google.rpc";23option objc_class_prefix = "RPC";24 25// The canonical error codes for gRPC APIs.26//27//28// Sometimes multiple error codes may apply. Services should return29// the most specific error code that applies. For example, prefer30// `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.31// Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.32enum Code {33 // Not an error; returned on success.34 //35 // HTTP Mapping: 200 OK36 OK = 0;37 38 // The operation was cancelled, typically by the caller.39 //40 // HTTP Mapping: 499 Client Closed Request41 CANCELLED = 1;42 43 // Unknown error. For example, this error may be returned when44 // a `Status` value received from another address space belongs to45 // an error space that is not known in this address space. Also46 // errors raised by APIs that do not return enough error information47 // may be converted to this error.48 //49 // HTTP Mapping: 500 Internal Server Error50 UNKNOWN = 2;51 52 // The client specified an invalid argument. Note that this differs53 // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments54 // that are problematic regardless of the state of the system55 // (e.g., a malformed file name).56 //57 // HTTP Mapping: 400 Bad Request58 INVALID_ARGUMENT = 3;59 60 // The deadline expired before the operation could complete. For operations61 // that change the state of the system, this error may be returned62 // even if the operation has completed successfully. For example, a63 // successful response from a server could have been delayed long64 // enough for the deadline to expire.65 //66 // HTTP Mapping: 504 Gateway Timeout67 DEADLINE_EXCEEDED = 4;68 69 // Some requested entity (e.g., file or directory) was not found.70 //71 // Note to server developers: if a request is denied for an entire class72 // of users, such as gradual feature rollout or undocumented allowlist,73 // `NOT_FOUND` may be used. If a request is denied for some users within74 // a class of users, such as user-based access control, `PERMISSION_DENIED`75 // must be used.76 //77 // HTTP Mapping: 404 Not Found78 NOT_FOUND = 5;79 80 // The entity that a client attempted to create (e.g., file or directory)81 // already exists.82 //83 // HTTP Mapping: 409 Conflict84 ALREADY_EXISTS = 6;85 86 // The caller does not have permission to execute the specified87 // operation. `PERMISSION_DENIED` must not be used for rejections88 // caused by exhausting some resource (use `RESOURCE_EXHAUSTED`89 // instead for those errors). `PERMISSION_DENIED` must not be90 // used if the caller can not be identified (use `UNAUTHENTICATED`91 // instead for those errors). This error code does not imply the92 // request is valid or the requested entity exists or satisfies93 // other pre-conditions.94 //95 // HTTP Mapping: 403 Forbidden96 PERMISSION_DENIED = 7;97 98 // The request does not have valid authentication credentials for the99 // operation.100 //101 // HTTP Mapping: 401 Unauthorized102 UNAUTHENTICATED = 16;103 104 // Some resource has been exhausted, perhaps a per-user quota, or105 // perhaps the entire file system is out of space.106 //107 // HTTP Mapping: 429 Too Many Requests108 RESOURCE_EXHAUSTED = 8;109 110 // The operation was rejected because the system is not in a state111 // required for the operation's execution. For example, the directory112 // to be deleted is non-empty, an rmdir operation is applied to113 // a non-directory, etc.114 //115 // Service implementors can use the following guidelines to decide116 // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:117 // (a) Use `UNAVAILABLE` if the client can retry just the failing call.118 // (b) Use `ABORTED` if the client should retry at a higher level. For119 // example, when a client-specified test-and-set fails, indicating the120 // client should restart a read-modify-write sequence.121 // (c) Use `FAILED_PRECONDITION` if the client should not retry until122 // the system state has been explicitly fixed. For example, if an "rmdir"123 // fails because the directory is non-empty, `FAILED_PRECONDITION`124 // should be returned since the client should not retry unless125 // the files are deleted from the directory.126 //127 // HTTP Mapping: 400 Bad Request128 FAILED_PRECONDITION = 9;129 130 // The operation was aborted, typically due to a concurrency issue such as131 // a sequencer check failure or transaction abort.132 //133 // See the guidelines above for deciding between `FAILED_PRECONDITION`,134 // `ABORTED`, and `UNAVAILABLE`.135 //136 // HTTP Mapping: 409 Conflict137 ABORTED = 10;138 139 // The operation was attempted past the valid range. E.g., seeking or140 // reading past end-of-file.141 //142 // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may143 // be fixed if the system state changes. For example, a 32-bit file144 // system will generate `INVALID_ARGUMENT` if asked to read at an145 // offset that is not in the range [0,2^32-1], but it will generate146 // `OUT_OF_RANGE` if asked to read from an offset past the current147 // file size.148 //149 // There is a fair bit of overlap between `FAILED_PRECONDITION` and150 // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific151 // error) when it applies so that callers who are iterating through152 // a space can easily look for an `OUT_OF_RANGE` error to detect when153 // they are done.154 //155 // HTTP Mapping: 400 Bad Request156 OUT_OF_RANGE = 11;157 158 // The operation is not implemented or is not supported/enabled in this159 // service.160 //161 // HTTP Mapping: 501 Not Implemented162 UNIMPLEMENTED = 12;163 164 // Internal errors. This means that some invariants expected by the165 // underlying system have been broken. This error code is reserved166 // for serious errors.167 //168 // HTTP Mapping: 500 Internal Server Error169 INTERNAL = 13;170 171 // The service is currently unavailable. This is most likely a172 // transient condition, which can be corrected by retrying with173 // a backoff. Note that it is not always safe to retry174 // non-idempotent operations.175 //176 // See the guidelines above for deciding between `FAILED_PRECONDITION`,177 // `ABORTED`, and `UNAVAILABLE`.178 //179 // HTTP Mapping: 503 Service Unavailable180 UNAVAILABLE = 14;181 182 // Unrecoverable data loss or corruption.183 //184 // HTTP Mapping: 500 Internal Server Error185 DATA_LOSS = 15;186}187 