SDK Error Codes (SDK for C)
SDK error codes are status codes returned by the SDK for C through obs_status enumeration. They are used to identify the execution results of requests, helping users locate and rectify faults.
SDK error codes includes the following:
- OBS API error codes. For details, see OBS Error Codes.
- SDK custom error codes. For details, see Table 1.
| Constant | Original Value | Description |
|---|---|---|
| OBS_STATUS_OK | 0 | The request is successful. |
| OBS_STATUS_InitCurlFailed | 1 | Failed to initialize curl. |
| OBS_STATUS_InternalError | 2 | Internal error. |
| OBS_STATUS_OutOfMemory | 3 | The local memory is insufficient. |
| OBS_STATUS_FailedToIInitializeRequest | 6 | Failed to initialize the request. |
| OBS_STATUS_XmlParseFailure | 23 | Failed to parse the XML file. |
| OBS_STATUS_NameLookupError | 33 | Domain name resolution failed. |
| OBS_STATUS_FailedToConnect | 34 | Failed to connect to the server. |
| OBS_STATUS_ConnectionFailed | 36 | Network connection failed. |
| OBS_STATUS_PartialFile | 38 | Network transmission interrupted. |
| OBS_STATUS_InvalidParameter | 39 | Invalid parameter. |
| OBS_STATUS_NoToken | 40 | The current number of concurrent tasks exceeds the upper limit (1,000 by default). The token here refers to the concurrent request token, not the security authentication token. You can use the set_online_request_max_count function to adjust the maximum number of concurrent tasks. |
| OBS_STATUS_OpenFileFailed | 41 | Failed to open the file. |
| OBS_STATUS_AccessDenied | 43 | The request is rejected. |
| OBS_STATUS_MalformedPolicy | 44 | The format of the request policy is incorrect. |
| OBS_STATUS_MalformedXML | 45 | The XML request format is incorrect. |
| OBS_STATUS_MethodNotAllowed | 46 | The request method is not allowed. |
| OBS_STATUS_SignatureDoesNotMatch | 47 | The signatures do not match. Check whether the AK, SK, and token are correct. |
| OBS_STATUS_ServiceUnavailable | 48 | Server exception. |
| OBS_STATUS_SlowDown | 49 | The request frequency is too high. |
| API | Function Signature | Description |
|---|---|---|
| The API for obtaining the error description | const char *obs_get_status_name(obs_status status) | Obtains the error description string based on the error code. |
| The API for checking whether retry is allowed | int obs_status_is_retryable(obs_status status) | Checks whether retry is allowed for a specified error code. The value 1 indicates that retry is allowed, and the value 0 indicates that retry is not allowed. |
Example
// Obtain the error description.
obs_status ret_status = obs_initialize(OBS_INIT_ALL);
if (OBS_STATUS_OK != ret_status)
{
printf("obs_initialize failed(%s).\n", obs_get_status_name(ret_status));
}
// Check whether retry is allowed.
if (obs_status_is_retryable(ret_status))
{
printf("This error is retryable.\n");
} Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot