aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/statuscodes.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/statuscodes.md')
-rw-r--r--doc/statuscodes.md19
1 files changed, 15 insertions, 4 deletions
diff --git a/doc/statuscodes.md b/doc/statuscodes.md
index 1cd72df30a..f2df9e00de 100644
--- a/doc/statuscodes.md
+++ b/doc/statuscodes.md
@@ -1,9 +1,20 @@
# Status codes and their use in gRPC
-gRPC uses a set of well defined status codes as part of the RPC API. All RPCs started 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 RPC.
+gRPC uses a set of well defined status codes as part of the RPC API. All
+RPCs started 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 RPC.
-The gRPC client and server-side implementations may also generate and return `status` on their own when errors happen.
-Only a subset of the pre-defined status codes are generated by the gRPC libraries. The following table lists these codes and summarizes the situations in which they are generated, either by the client or the server-side library implementation.
+The gRPC client and server-side implementations may also generate and
+return `status` on their own when errors happen. Only a subset of
+the pre-defined status codes are generated by the gRPC libraries. This
+allows applications to be sure that any other code it sees was actually
+returned by the application (although it is also possible for the
+server-side to return one of the codes generated by the gRPC libraries).
+
+The following table lists the codes that may be returned by the gRPC
+libraries (on either the client-side or server-side) and summarizes the
+situations in which they are generated.
| Case | Code | Generated at Client or Server |
| ------------- |:-------------| :-----:|
@@ -26,7 +37,7 @@ Only a subset of the pre-defined status codes are generated by the gRPC librarie
| Response cardinality violation (method requires exactly one response but server sent some other number of responses) | UNIMPLEMENTED | Client|
| Error parsing response proto | INTERNAL | Client|
| Error parsing request proto | INTERNAL | Server|
-
+| Sent or received message was larger than configured limit | RESOURCE_EXHAUSTED | Both |
The following status codes are never generated by the library:
- INVALID_ARGUMENT