Skip to content

Instantly share code, notes, and snippets.

@hamakn
Created March 15, 2019 11:00
Show Gist options
  • Save hamakn/708b9802ca845eb59f3975dbb3ae2a01 to your computer and use it in GitHub Desktop.
Save hamakn/708b9802ca845eb59f3975dbb3ae2a01 to your computer and use it in GitHub Desktop.
gRPC Code and HTTP Status Code

https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

List order by gRPC Code

gRPC Code HTTP Status Code
OK = 0 200 OK
CANCELLED = 1 499 Client Closed Request
UNKNOWN = 2 500 Internal Server Error
INVALID_ARGUMENT = 3 400 Bad Request
DEADLINE_EXCEEDED = 4 504 Gateway Timeout
NOT_FOUND = 5 404 Not Found
ALREADY_EXISTS = 6 409 Conflict
PERMISSION_DENIED = 7 403 Forbidden
RESOURCE_EXHAUSTED = 8 429 Too Many Requests
FAILED_PRECONDITION = 9 400 Bad Request
ABORTED = 10 409 Conflict
OUT_OF_RANGE = 11 400 Bad Request
UNIMPLEMENTED = 12 501 Not Implemented
INTERNAL = 13 500 Internal Server Error
UNAVAILABLE = 14 503 Service Unavailable
DATA_LOSS = 15 500 Internal Server Error
UNAUTHENTICATED = 16 401 Unauthorized

List order by HTTP Status Code

gRPC Code HTTP Status Code
OK = 0 200 OK
INVALID_ARGUMENT = 3 400 Bad Request
FAILED_PRECONDITION = 9 400 Bad Request
OUT_OF_RANGE = 11 400 Bad Request
UNAUTHENTICATED = 16 401 Unauthorized
PERMISSION_DENIED = 7 403 Forbidden
NOT_FOUND = 5 404 Not Found
ALREADY_EXISTS = 6 409 Conflict
ABORTED = 10 409 Conflict
RESOURCE_EXHAUSTED = 8 429 Too Many Requests
CANCELLED = 1 499 Client Closed Request
UNKNOWN = 2 500 Internal Server Error
INTERNAL = 13 500 Internal Server Error
DATA_LOSS = 15 500 Internal Server Error
UNIMPLEMENTED = 12 501 Not Implemented
UNAVAILABLE = 14 503 Service Unavailable
DEADLINE_EXCEEDED = 4 504 Gateway Timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment