tencent cloud

All product documents
Cloud Object Storage
Troubleshooting
Last updated: 2024-06-25 10:53:13
Troubleshooting
Last updated: 2024-06-25 10:53:13

Overview

If a COS request fails when calling this SDK, it will throw a CosXmlClientException (client exception) or CosXmlServiceException (server exception).
The client exception, CosXmlClientException, results from unexpected interaction issues between the client and the COS server, such as a failure to connect to the server, a failure to parse the data returned by the server, or the occurrence of an IO exception when reading a local file.
The server exception, CosXmlServiceException, occurs when the client interacts with the COS server normally, but the operation fails. For example, the client accesses a bucket that does not exist, deletes a file that does not exist, or does not have the permission to perform an operation.

Client Exceptions

Inherited from Exception, CosClientException is used in the same way as Exception. An additional member errorCode is also added, as described below:
Member
Description
Type
errorCode
Client error code, such as 10000, which indicates a parameter verification failure. For more information, see Error Codes
int

Server Exceptions

The server exception, CosXmlServiceException, occurs when, for example, the client accesses a bucket that does not exist, deletes a file that does not exist, or does not have the permission to perform an operation, etc. CosXmlServiceException contains the status code returned by the server, the requestid, the error details, and so on. After an exception is captured, we recommended that you print out the entire exception as it contains necessary factors for troubleshooting. The member variables of exception are described as follows:
Member
Description
Type
requestId
Request ID, used to identify a request. It is very important for troubleshooting.
string
statusCode
Status code in the response. 4xx indicates that the request failed due to a client exception. 5xx indicates that the request failed due to a server exception. For more information, see Error Codes.
string
errorCode
Error code returned by the body when the request fails. For more information, see Error Codes.
string
errorMessage
Error message returned by the body when the request fails. For more information, see Error Codes.
string

Using the Diagnosis Tool

COS provides a self-help diagnosis tool to help you quickly locate request problems and debug code.

Directions

1. Copy the request ID (RequestId) returned when the request error occurs.
2. Click Diagnosis Tool.

3. Enter RequestId and click Diagnose.
4. Wait and view the diagnostic result.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support