grpc / grpc/grpc-web

Cardinality violations should use error code “unimplemented”

Open
#1,429 2 comments 0 reactions 0 assignees View on GitHub
blocked/discussion spec
Dominant language
JavaScript
Stars
9.3k
Forks
802
Avg merge
1d 7h
Merged PRs (30d)
5

Description

The gRPC docs for error codes state that both client and server should use the `unimplemented` code for cardinality violations. See table at the bottom of this doc (you can search for “cardinality violation” in the doc): https://grpc.github.io/grpc/core/md_doc_statuscodes.html.

A cardinality violation is when a response stream contains an incorrect number of messages. Specifically, when the response stream for a unary RPC contains zero messages with an OK status or more than one message. (The same goes for client-stream RPCs, which also expect a unary response, but this package does not support client-streaming.)

The client in this package returns an `unknown` error in this situation instead of `unimplemented`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.