错误码
更新时间:2026-06-17
响应状态码(Status Code)
应使用标准的HTTP状态码(Status Code),遵循RFC 2616 section 6.1.1。
- 1xx: Informational - Request received, continuing process
- 2xx: Success - The action was successfully received, understood, and accepted
- 3xx: Redirection - Further action must be taken in order to complete the request
- 4xx: Client Error - The request contains bad syntax or cannot be fulfilled
- 5xx: Server Error - The server failed to fulfill an apparently valid request
| 参数名 | 类型 | 说明 |
|---|---|---|
| requestId | String | 导致该错误的requestId |
| code | String | 字符串,用于表示具体错误类型 |
| message | String | 有关该错误的详细说明 |
示例:
JSON
1{
2 "requestId": "ae2225f7-1c2e-427a-a1ad-5413b762957d",
3 "code": "NoSuchKey",
4 "message": "The resource you requested does not exist"
5}
公共错误码(Error Code)
下表列出了所有API的公共错误码。
| Code | Message | HTTP Status Code | 说明 |
|---|---|---|---|
| AccessDenied | Access denied. | 403 Forbidden | 无权限访问对应的资源 |
| InappropriateJSON | The JSON you provided was well-formed and valid, but not appropriate for this operation. | 400 Bad Request | 请求中的JSON格式正确,但语义上不符合要求。如缺少某个必需项,或者值类型不匹配等。出于兼容性考虑,对于所有无法识别的项应直接忽略,不应该返回这个错误。 |
| InternalError | We encountered an internal error. Please try again. | 500 Internal Server Error | 所有未定义的其他错误。在有明确对应的其他类型的错误时(包括通用的和服务自定义的)不应该使用。 |
| InvalidAccessKeyId | The Access Key ID you provided does not exist in our records. | 403 Forbidden | Access Key ID不存在 |
| InvalidHTTPAuthHeader | The HTTP authorization header is invalid. Consult the service documentation for details. | 400 Bad Request | Authorization头域格式错误 |
| InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 Bad Request | HTTP body格式错误。例如不符合指定的Encoding等 |
| InvalidURI | Could not parse the specified URI. | 400 Bad Request | URI形式不正确。例如一些服务定义的关键词不匹配等。对于ID不匹配等问题,应定义更加具体的错误码,例如NoSuchKey。 |
| MalformedJSON | The JSON you provided was not well-formed. | 400 Bad Request | JSON格式不合法 |
| InvalidVersion | The API version specified was invalid. | 404 Not Found | URI的版本号不合法 |
| OptInRequired | A subscription for the service is required. | 403 Forbidden | 没有开通对应的服务 |
| PreconditionFailed | The specified If-Match header doesn't match the ETag header. | 412 Precondition Failed | 详见[ETag的使用](#etag) |
| RequestExpired | Request has expired. Timestamp date is XXX. | 400 Bad Request | 请求超时。XXX要改成[x-bce-date](#req_header_x-bce-date)的值。如果请求中只有Date,则需要将Date转换为[本规范指定的格式](#datetime)。 |
| IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. | 403 Forbidden | clientToken对应的API参数不一样。 |
| SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check your Secret Access Key and signing method. Consult the service documentation for details. | 400 Bad Request | Authorization头域中附带的签名和服务端验证不一致 |
RapidFS 公共错误码(Error Code)
| Code | Message | HTTP Status Code | 说明 |
|---|---|---|---|
| NotSupportOperation | Operation not available. | 409 | 不支持当前操作。 |
| InsufficientBalance | Insufficient balance, please check remaining balance | 403 | 余额不足。 |
| PaymentFailed | payment failed, please check remaining balance | 403 | 支付失败。 |
| BadRequest | Bad request parameters or illegal request. | 400 | 无效或非法的请求参数。 |
| OperationDenied | No permission to accessor or permission error. | 409 | 无访问权限。 |
| NoSuchObject | The specified object is not found or resource do not exist. | 404 | 访问的资源或对象不存在。 |
| ServiceInternalError | Internal service occurs error. | 500 | 服务内部错误。 |
评价此篇文章
