7. Error Codes
Error codes are 32-bit fields used in RST_STREAM and GOAWAY frames to convey the reasons for stream or connection termination.
Error Code Registry
| Name | Code | Description |
|---|---|---|
| NO_ERROR | 0x0 | Graceful shutdown |
| PROTOCOL_ERROR | 0x1 | Protocol error detected |
| INTERNAL_ERROR | 0x2 | Internal error |
| FLOW_CONTROL_ERROR | 0x3 | Flow-control limits exceeded |
| SETTINGS_TIMEOUT | 0x4 | Settings not acknowledged |
| STREAM_CLOSED | 0x5 | Frame received after stream closed |
| FRAME_SIZE_ERROR | 0x6 | Frame size incorrect |
| REFUSED_STREAM | 0x7 | Stream not processed |
| CANCEL | 0x8 | Stream cancelled |
| COMPRESSION_ERROR | 0x9 | Compression state invalid |
| CONNECT_ERROR | 0xa | TCP connection error |
| ENHANCE_YOUR_CALM | 0xb | Processing capacity exceeded |
| INADEQUATE_SECURITY | 0xc | Security requirements not met |
| HTTP_1_1_REQUIRED | 0xd | Use HTTP/1.1 instead |
Usage
Error codes are used in:
- RST_STREAM frames: To terminate individual streams
- GOAWAY frames: To terminate connections
Unknown error codes MUST be treated as INTERNAL_ERROR.