文档

状态码说明

状态码参考

搜索开发工作台服务的API/SDK调用将返回状态码以标识调用结果。请通过返回结果中的codestatus字段定位调用成功或失败的详细信息。

下表列出搜索开发工作台通用状态码信息。

类别

httpStatusCode

code

message

错误说明

请求错误

400

InvalidParameter

Required parameter(s) missing or invalid, please check the request parameters.

接口调用参数不合法。

400

ServiceIdNotExist

service_id is not exist.

服务ID不存在。

429

Throttling

Requests throttling triggered.

接口调用触发限流。

429

Throttling.RateQuota

Requests rate limit exceeded, please try again later.

调用频次触发限流,比如每秒钟请求数。

429

Throttling.AllocationQuota

Allocated quota exceeded, please increase your quota limit.

一段时间调用量触发限流,比如每分钟生成Token数。

429

Throttling.AllocationQuota

Free allocated quota exceeded.

免费额度已经耗尽,并且模型未开通计费访问。

服务端错误

500

InternalServerError

An internal error has occured, please try again later or contact service support.

系统内部错误。

返回字段参考

搜索开发工作台服务在访问失败的情况下,除HTTP状态码外还会返回错误的细节信息,一个访问失败示例的调用可能有如下所示返回:

{
    "request_id": "817964CD-1B84-4AE1-9B63-4FB99734DD41",
    "latency": 0,
    "code": "InvalidParameter",
    "message": "JSON parse error: Invalid UTF-8 start byte 0xbc; nested exception is com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xbc\n at line: 2, column: 19]"
}

返回参数说明

返回参数

类型

说明

HTTP请求返回码

integer

200(HTTPStatus.OK)表示请求成功,否则表示请求失败,可以通过code获取错误码,通过message字段获取错误详细信息。

request_id

string

系统对一次API调用赋予的唯一标识。当排查问题的时候,开发者可以将 request_id 进行反馈以定位某次调用。

code

string

如果失败表示错误码,参考状态码表“错误代码”部分。

message

string

如果失败,内容为失败详细信息,参考状态码表“错误信息”部分,需要注意的是这部分内容可能会随着具体的情况有所不同,可能会输出更加有针对性的内容,不一定和上述码表中的信息完全一致。

  • 本页导读 (0)