OLD | NEW |
(Empty) | |
| 1 # Status codes and their use in gRPC |
| 2 |
| 3 gRPC uses a set of well defined status codes as part of the RPC API. All RPCs st
arted at a client return a `status` object composed of an integer `code` and a
string `message`. The server-side can choose the status it returns for a given R
PC. |
| 4 |
| 5 The gRPC client and server-side implementations may also generate and return `st
atus` on their own when errors happen. |
| 6 Only a subset of the pre-defined status codes are generated by the gRPC librarie
s. The following table lists these codes and summarizes the situations in which
they are generated, either by the client or the server-side library implementati
on. |
| 7 |
| 8 | Case | Code | Generated at Client or Server | |
| 9 | ------------- |:-------------| :-----:| |
| 10 | Client Application cancelled the request | CANCELLED | Both | |
| 11 | Deadline expires before server returns status | DEADLINE_EXCEEDED | Both | |
| 12 | Method not found at server | UNIMPLEMENTED | Server| |
| 13 | Server shutting down | UNAVAILABLE | Server| |
| 14 | Server side application throws an exception (or does something other than retu
rning a Status code to terminate an RPC) | UNKNOWN | Server| |
| 15 | No response received before Deadline expires. This may occur either when the c
lient is unable to send the request to the server or when the server fails to re
spond in time. | DEADLINE_EXCEEDED | Both| |
| 16 | Some data transmitted (e.g., request metadata written to TCP connection) befor
e connection breaks | UNAVAILABLE | Client | |
| 17 | Could not decompress, but compression algorithm supported (Client -> Server)
| INTERNAL | Server | |
| 18 | Could not decompress, but compression algorithm supported (Server -> Client)
| INTERNAL | Client | |
| 19 | Compression mechanism used by client not supported at server | UNIMPLEMENTED
| Server | |
| 20 | Server temporarily out of resources (e.g., Flow-control resource limits reache
d) | RESOURCE_EXHAUSTED | Server| |
| 21 | Flow-control protocol violation | INTERNAL | Both | |
| 22 | Error parsing returned status | UNKNOWN | Client | |
| 23 | Incorrect Auth metadata ( Credentials failed to get metadata, Incompatible cre
dentials set on channel and call, Invalid host set in `:authority` metadata, etc
.) | UNAUTHENTICATED | Both | |
| 24 | Error parsing response proto | INTERNAL | Client| |
| 25 | Error parsing request proto | INTERNAL | Server| |
| 26 |
| 27 |
| 28 The following status codes are never generated by the library: |
| 29 - INVALID_ARGUMENT |
| 30 - NOT_FOUND |
| 31 - ALREADY_EXISTS |
| 32 - FAILED_PRECONDITION |
| 33 - ABORTED |
| 34 - OUT_OF_RANGE |
| 35 - DATA_LOSS |
OLD | NEW |