响应处理
错误码
100+ 预定义错误码速查表
错误码规范
错误码采用 5 位数字格式,前 3 位对应 HTTP 状态码:
XXXXX
├── XXX: HTTP 状态码(如 400、401、404、500)
└── XX: 具体错误序号(00-99)HTTP 状态码映射
| 错误码前缀 | HTTP 状态码 | 说明 |
|---|---|---|
| 400xx | 400 | Bad Request - 请求错误 |
| 401xx | 401 | Unauthorized - 未授权 |
| 403xx | 403 | Forbidden - 禁止访问 |
| 404xx | 404 | Not Found - 未找到 |
| 405xx | 405 | Method Not Allowed |
| 408xx | 408 | Request Timeout |
| 409xx | 409 | Conflict - 冲突 |
| 410xx | 410 | Gone - 已删除 |
| 413xx | 413 | Payload Too Large |
| 422xx | 422 | Unprocessable Entity |
| 429xx | 429 | Too Many Requests |
| 500xx | 500 | Internal Server Error |
| 502xx | 502 | Bad Gateway |
| 503xx | 503 | Service Unavailable |
| 504xx | 504 | Gateway Timeout |
错误码表
400 Bad Request
字段
类型
401 Unauthorized
字段
类型
403 Forbidden
字段
类型
404 Not Found
字段
类型
405 Method Not Allowed
字段
类型
406 Not Acceptable
字段
类型
408 Request Timeout
字段
类型
409 Conflict
字段
类型
410 Gone
字段
类型
413 Payload Too Large
字段
类型
415 Unsupported Media Type
字段
类型
422 Unprocessable Entity
字段
类型
429 Too Many Requests
字段
类型
500 Internal Server Error
字段
类型
502 Bad Gateway
字段
类型
503 Service Unavailable
字段
类型
504 Gateway Timeout
字段
类型