Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification update for error code HTTP status #130

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,18 @@ gRPC. Only the codes below are valid — there are no user-defined codes.

| Code | HTTP Status | Description |
| ---- | ----------- | ----------- |
| `canceled` | 408 Request Timeout | RPC canceled, usually by the caller. |
| `canceled` | 499 Client Closed Request | RPC canceled, usually by the caller. |
| `unknown` | 500 Internal Server Error | Catch-all for errors of unclear origin and errors without a more appropriate code. |
| `invalid_argument` | 400 Bad Request | Request is invalid, regardless of system state. |
| `deadline_exceeded` | 408 Request Timeout | Deadline expired before RPC could complete or before the client received the response. |
| `deadline_exceeded` | 504 Gateway Timeout | Deadline expired before RPC could complete or before the client received the response. |
| `not_found` | 404 Not Found | User requested a resource (for example, a file or directory) that can't be found. |
| `already_exists` | 409 Conflict | Caller attempted to create a resource that already exists. |
| `permission_denied` | 403 Forbidden | Caller isn't authorized to perform the operation. |
| `resource_exhausted` | 429 Too Many Requests | Operation can't be completed because some resource is exhausted. Use unavailable if the server is temporarily overloaded and the caller should retry later. |
| `failed_precondition` | 412 Precondition Failed | Operation can't be completed because the system isn't in the required state. |
| `failed_precondition` | 400 Bad Request | Operation can't be completed because the system isn't in the required state. |
| `aborted` | 409 Conflict | The operation was aborted, often because of concurrency issues like a database transaction abort. |
| `out_of_range` | 400 Bad Request | The operation was attempted past the valid range. |
| `unimplemented` | 404 Not Found | The operation isn't implemented, supported, or enabled. |
| `unimplemented` | 501 Not Implemented | The operation isn't implemented, supported, or enabled. |
| `internal` | 500 Internal Server Error | An invariant expected by the underlying system has been broken. Reserved for serious errors. |
| `unavailable` | 503 Service Unavailable | The service is currently unavailable, usually transiently. Clients should back off and retry idempotent operations. |
| `data_loss` | 500 Internal Server Error | Unrecoverable data loss or corruption. |
Expand Down Expand Up @@ -561,17 +561,11 @@ unknown or internal), Connect maps to the semantically-equivalent error code.

| HTTP Status | Inferred Code |
| ----------- | ------------- |
| 400 Bad Request | `invalid_argument` |
| 400 Bad Request | `internal` |
| 401 Unauthorized | `unauthenticated` |
| 403 Forbidden | `permission_denied` |
| 404 Not Found | `unimplemented` |
| 408 Request Timeout | `deadline_exceeded` |
| 409 Conflict | `aborted` |
| 412 Precondition Failed | `failed_precondition` |
| 413 Payload Too Large | `resource_exhausted` |
| 415 Unsupported Media Type | `internal` |
| 429 Too Many Requests | `unavailable` |
| 431 Request Header Fields Too Large | `resource_exhausted` |
| 502 Bad Gateway | `unavailable` |
| 503 Service Unavailable | `unavailable` |
| 504 Gateway Timeout | `unavailable` |
Expand Down