Client does not report correct error codes per the spec for HTTP status code mapping
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 802
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
A well-formed gRPC response always has an HTTP status code of “200 OK”. The gRPC docs specify a table for mapping other HTTP status codes to gRPC error codes: https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md.
The client in this package varies from the above table. Specifically, here are HTTP status codes which produce an unexpected error code:
HTTP status code | Expected error code | Actual error code
-- | -- | --
400 Bad Request | internal | unknown
404 Not Found | unimplemented | unknown
409 Conflict | unknown | aborted
412 Precondition Failed | unknown | failed_precondition
429 Too Many Requests | unavailable | unknown
502 Bad Gateway | unavailable | unknown
504 Gateway Timeout | unavailable | unknown
Contributor guide
Research direction
Start by reading the HTTP-to-gRPC status mapping specification linked in the issue and locate the client code that converts HTTP status codes into gRPC errors. Add coverage for the seven listed status codes, then verify that each produces the expected error code from the specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100