异常状态码一览表

at 6年前  ca Php  pv 1859  by touch  

### 异常状态码一览表

> 请先阅读本文档下有关异常处理的章节。

以下的异常状态码是各个基础服务通用的,各个基础服务可根据业务需要自行扩展,但禁止覆写通用异常状态码,以免引起歧义。

需要注意的是,`errmsg`字段的值仅为`errcode`字段的值对照的错误信息,供业务方判断异常状态。但业务方在业务逻辑上不应该依赖`errmsg`字段的值,而应该只依赖`errcode`字段。

| errcode | errmsg | description |
| ------- | ------ | ----------- |
| 0 | ok | 无异常 |
| 40000 | data parsing error | 请求参数格式异常 |
| 40001 | lack of parameter | 缺少参数 |
| 40002 | invalid parameter | 非法参数 |
| 40011 | lack of query | 缺少查询条件 |
| 40012 | invalid query | 非法查询条件 |
| 40021 | lack of file | 缺少文件 |
| 40022 | invalid file | 非法文件 |
| 40099 | payload too large | 请求内容大小超出限制 |
| 40100 | no access | 无法访问 |
| 40101 | lack of grant | 缺少授权信息 |
| 40102 | invalid grant | 非法授权信息 |
| 40103 | lack of signature | 缺少请求签名 |
| 40104 | invalid signature | 非法请求签名 |
| 40105 | lack of app key | 缺少应用标识 |
| 40106 | invalid app key | 非法应用标识 |
| 40110 | hotlinking or referrer not in whiltlist | 非法请求来源 |
| 40300 | permission required | 权限不足 |
| 40400 | non-exists resourse | 不存在的资源 |
| 40401 | obsoleted resourse | 已过期的资源 |
| 40500 | invalid method or no route matched | 路由错误 |
| 40800 | timeout or timestamp expired | 请求超时 |
| 40801 | lack of timestamp | 缺少时间戳 |
| 40802 | invalid timestamp | 非法时间戳 |
| 42900 | suspected replay attack | 重放攻击 |
| 42901 | duplicate signature | 请求签名冲突 |
| 50000 | fatal error | 致命错误 |
| 50031 | remote invoking failed | 远程调用失败 |

---

#### [返回章节](./README.md)

#### [返回首页](../README.md)


版权声明

本文仅代表作者观点,不代表码农殇立场。
本文系作者授权码农殇发表,未经许可,不得转载。

 

扫一扫在手机阅读、分享本文

已有0条评论