Feature Overview
If an SDK API call to request the COS service fails, the system will return the error information in the callback.
Error Sample
cos.headBucket({Bucket: 'examplebucket-1250000000',Region: 'COS_REGION', /* The region where the bucket is located, required field */}, function(err, data) {if (err) {console.log(err.error);}});
Client Exceptions
Parameter | ParameterDescription | Local Disk Types |
err | Returns a network or service error when the request fails. If the request is successful, this is empty. For more information, see Error Codes | Object |
- error | Error information | Object/String |
Server Exceptions
Parameter | ParameterDescription | Local Disk Types |
err | Returns a network or service error when the request fails. If the request is successful, this is empty. For more information, see Error Codes | Object |
- statusCode | HTTP status code, such as 200, 403, and 404 | Number |
- headers | Returned headers | Object |
- error | Error information | Object/String |
- - Code | Error code returned by the body when the request fails. For more information, see Error Codes | String |
- - Message | Error message returned by the body when the request fails. For more information, see Error Codes | String |
- - RequestId | Unique ID of the request in the server request log that can be submitted when you contact us for troubleshooting | String |
Using self-diagnose tools
COS provides a self-help diagnosis tool to help you quickly locate request errors and debug the code.
Directions
1. Copy the request ID (
RequestId) returned when the request error occurs.2. Click Diagnosis Tool.
3. Enter the RequestId to be diagnosed in the RequestId input box at the top, and click Start Diagnosis. Please wait patiently for a few minutes to view the corresponding intelligent diagnosis results.