
# 错误码
调用接口出错后，将不会返回结果数据。调用方可根据每个接口对应的错误码来定位错误原因。当调用出错时，HTTPS请求返回一个4xx或5xx的HTTPS状态码。返回的消息体中是具体的错误代码及错误信息。
#### 错误响应Body体格式说明
当接口调用出错时，会返回错误码及错误信息说明，错误响应的Body体格式如下所示。
```
{ 
    "error_msg": "The format of message is error", 
    "error_code": "AS.0001" 
}
```
其中，error_code表示错误码，error_msg表示错误描述信息。
#### 错误码说明
自然语言处理错误码如[表1]所示，ModelArts的错误码请参考[错误码](https://support.huaweicloud.com/api-modelarts/modelarts_03_0095.html)。
当您调用API时，如果遇到"APIGW"开头的错误码，请参见[API网关错误码](https://support.huaweicloud.com/devg-apisign/api-sign-errorcode.html)进行处理。
 表1错误码 
| 状态码 | 错误码            | 错误信息                                                  | 描述             | 处理措施                                                                                                                                                                                                                             |
|:---|:---|:---|:---|:---|
| 401 | NLP.0000       | user has no privilege of beta!                        | 用户不具备公测权限。     | 请根据界面提示，申请公测权限。                                                                                                                                                                                                                  |
| 401 | NLP.0101       | Authentication failed. Please verify the token        | 认证失败。          | 检查Token是否正确，使用正确的Token重新尝试。 获取Token方式请见[API Explorer获取Token](https://support.huaweicloud.com/nlp_faq/iam_01_0034.html)和[Postman获取Token](https://support.huaweicloud.com/nlp_faq/iam_01_034.html)。 |
| 401 | NLP.0102       | authentication info missing!                          | 认证信息缺失。        | 补全正确的认证信息后重新尝试。                                                                                                                                                                                                                  |
| 401 | NLP.0103       | get ops token failed                                  | 认证信息获取失败。      | 检查Token是否正确，使用正确的Token重新尝试。 获取Token方式请见[API Explorer获取Token](https://support.huaweicloud.com/nlp_faq/iam_01_0034.html)和[Postman获取Token](https://support.huaweicloud.com/nlp_faq/iam_01_034.html)。  |
| 400 | NLP.0301       | query param error                                     | 请求参数异常。        | 检查请求参数字段名，修改正确后重新尝试。                                                                                                                                                                                                             |
| 400 | NLP.0303       | request method not support                            | http请求方式不支持。   | 检查请求方式，修改正确后重新尝试。                                                                                                                                                                                                                |
| 400 | NLP.0304       | http message not readable                             | http消息无法读取。    | 检查请求消息格式，修改正确后重新尝试。                                                                                                                                                                                                              |
| 400 | NLP.0305       | http media type is not supported                      | http媒体方式不支持。   | 检查请求媒体方式，修改正确后重新尝试。                                                                                                                                                                                                              |
| 500 | NLP.0306       | Http request timed out.                               | http请求超时。      | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.0201       | inner service exception                               | 内部服务异常。        | 服务后台错误。您可以在[API Explorer](https://apiexplorer.developer.huaweicloud.com/apiexplorer/doc?product=NLP&api=RunSegment)中查看代码示例，调试接口。                                                              |
| 500 | NLP.0401       | obsClient is null                                     | OBSClient为空。   | 服务后台错误，请联系技术支持。                                                                                                                                                                              |
| 500 | NLP.0402       | obs closed failed                                     | OBSClient关闭失败。 | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.0403       | upload file for obs failed                            | OBS上传文件失败。     | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.0405       | download file for obs failed                          | OBS下载文件失败。     | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.1101       | request deliver failed                                | 服务下发失败。        | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.1102       | response body parameter failed                        | 服务返回参数解析出错。    | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.1201       | purchase failed                                       | 购买套餐包失败。       | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 400 | NLP.1202       | purchase disabled                                     | 不可购买。          | 该产品暂时不允许购买，请尝试购买其他产品。                                                                                                                                                                                                            |
| 400 | NLP.1203       | tenant is frozen!                                     | 用户账号欠费。        | 用户账号欠费，请充值后重新使用或购买。 充值请登录华为云官网，单击右上角的"账号名\>费用与成本"，在"资金管理\>充值"页面为自己的账号充值，确保当前账号未欠费。                                                                                                                  |
| 400 | NLP.1204       | the resource of the tenant is frozen                  | 租户该资源被冻结       | 用户资源被冻结，请检查是否违规或者欠费。                                                                                                                                                                                                             |
| 400 | NLP.1205       | can not repeat buy                                    | 不可重复购买         | 该资源不允许重复购买。                                                                                                                                                                                                                      |
| 400 | NLP.1206       | User is not verified                                  | 用户未实名          | 用户未实名，请实名制后重新使用或者购买。 请登录华为云官网，单击右上角的"账号中心\>费用中心"，在左侧导航栏选择"实名认证"，进行实名认证。                                                                                                                          |
| 400 | NLP.1207       | this user have no permission                          | 无购买权限          | 无购买权限，请联系技术支持。                                                                                                                                                                                                                   |
| 400 | NLP.3201       | illegal parameter.                                    | 参数错误。          | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.3202       | template parse error.                                 | 模板解析错误。        | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.3203       | formula calculation error                             | 公式计算错误。        | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.3204       | the template is not exist.                            | 模板资源不存在。       | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.4101       | w2v file is null                                      | 文件为空或者不存在。     | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.4201       | NLPU Inner service exception                          | NLPU内部服务异常。    | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.4302       | Response parameters cannot be resolved                | 内部数据解析错误。      | 服务后台错误，请联系技术支持。                                                                                                                                                                                                                  |
| 500 | NLP.6101       | Server inner error.                                   | 机器翻译服务内部异常。    | 请联系服务管理员。                                                                                                                                                                                                                        |
| 400 | NLP.6302       | Reaching concurrency limitation, please try it later. | 达到流控上限。        | 请稍后重试。                                                                                                                                                                                                                           |
| 400 | NLP.6303       | Obtaining the file from the provided url failed.      | 无法从OBS桶获取文件。   | 请检查OBS桶是否为公共读状态。                                                                                                                                                                                                                 |
| 400 | NLP.6304       | Task is not found!                                    | 对应任务不存在。       | 请检查是否输入错误的job-id，或任务已经过期。                                                                                                                                                                                                        |
| 400 | NLP.6305       | 删除                                                    | 不支持的文档格式。      | 请检查type字段指定的文档格式是否正确。                                                                                                                                                                                                            |
| 400 | NLP.6306       | Empty file error.                                     | 无效文件。          | 请检查文件是否为空或文件大小为0byte。                                                                                                                                                                                                            |
| 400 | NLP.6307       | File size is over the limit.                          | 文档页数超过上限。      | 请减少单次请求的文档页数。当前页数上限为250页。                                                                                                                                                                                                        |
| 500 | NLP.6308       | Task is overtime.                                     | 任务超时。          | 请重试。                                                                                                                                                                                                                             |
| 403 | ModelArts.0203 | Invalid token.                                        | 无效的token.      | 重新生成一个token进行重试。 获取Token方式请见[API Explorer获取Token](https://support.huaweicloud.com/nlp_faq/iam_01_0034.html)和[Postman获取Token](https://support.huaweicloud.com/nlp_faq/iam_01_034.html)。                |
   
