All Products
Search
Document Center

Alibaba Cloud SDK:Handle an exception

Last Updated:May 31, 2022

If the return value of the code parameter is not 200, OK, Success or success in Classic SDK for Node.js, the return value indicates an exception, which is not caused by network issues. You can configure more values for the code parameter in an SDK client to indicate successful calls.

var client = new RPCClient({
  accessKeyId: '<accessKeyId>',
  accessKeySecret: '<accessKeySecret>',
  endpoint: '<endpoint>',
  apiVersion: '<apiVersion>',
  opts: {
    // Configure more values for the code parameter to indicate successful calls.
    codes: ["0", 0]
  }
});