🔌 gRPC Beginner

What is the gRPC status code?

Answer

gRPC uses a standardized set of status codes to communicate the outcome of an RPC call, similar to HTTP status codes but with different semantics. Key codes: OK (0, success), CANCELLED (1, client cancelled), UNKNOWN (2, general server error), INVALID_ARGUMENT (3, bad request data), NOT_FOUND (5, resource not found), ALREADY_EXISTS (6, creation conflict), PERMISSION_DENIED (7, authorization failure), RESOURCE_EXHAUSTED (8, quota/rate limit exceeded), FAILED_PRECONDITION (9, operation not valid in current state), UNAUTHENTICATED (16, missing/invalid credentials), INTERNAL (13, server-side error). Status codes are sent in HTTP/2 trailing metadata as grpc-status. A status also includes an optional human-readable grpc-message string and structured error details.