All Products
Search
Document Center

Object Storage Service:Error handling

Last Updated:Sep 18, 2023

If a request error occurs when you use Object Storage Service (OSS) SDK for Node.js, an exception is thrown. Detailed information about the error is recorded in a log file. By default, the detailed information about the error is recorded in the oss_sdk.log file.

ClientError

ClientErrors indicate errors occurred inside the SDK, such as parameter setting errors and errors occurred when objects are modified in the resumable upload or download process.

RequestError

RequestErrors are thrown by OSS SDK for Node.js when an interruption or exception occurs on the network. Check the network connectivity and make sure that the network is resumed before you use OSS SDK for Node.js again.

ServerError

ServerErrors are the parsing results of the error messages generated by the server and indicate errors that occurred on the server. ServerErrors include the following attributes:

  • status: the HTTP status code of the error request.

  • code: the OSS error code.

  • message: the OSS error message.

  • requestId: the UUID of the request. If the error persists, you can provide the request ID to seek help from technical support.

For more information about common error messages in OSS, see Overview.

Debugging

If you encounter client or server errors when you use OSS SDK for Node.js, you can enable debugging by setting the DEBUG environment variable.

DEBUG=ali-oss node app.js

In a browser environment, set the localStorage.debug variable in the console to enable debugging.

localStorage.debug = 'ali-oss'