aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2017-04-12 12:52:47 -0700
committerGravatar Mark D. Roth <roth@google.com>2017-04-12 12:52:47 -0700
commit2a86d3f39902f9256260b4452f22e75cc79bc8ff (patch)
treeebb4df2f8adb8edfcb8cadcc8209e8ef0376f370 /doc
parent9ee816e6ef4f98afd076a22ecc631e2d0266ba7b (diff)
Update status codes doc.
Diffstat (limited to 'doc')
-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