• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (Node.js SDK)
  4. Initialization
  5. Callback Functions

Callback Functions

API Description

After an ObsClient API is called, the calling result will be contained in the callback function which contains the err and result parameters in sequence. If the err parameter is not null, an error occurs during API calling. Otherwise, the API calling is complete. In such conditions, you need to obtain the HTTP status code from the result parameter to check whether the operation is successful.

Method Definition

function callback(err, result){}

Parameter Description

Parameter

Field

Type

Description

err

  

String

Error information

result

  

Object

SDK common result object

  

CommonMsg

Object

Common information generated after the API calling is complete, including the HTTP status code and error code

  

Status

Number

HTTP status code. If the value is smaller than 300, the operation succeeds. Otherwise, the operation fails.

Code

String

Error code returned by the OBS server. If Status is smaller than 300, the value is null.

Message

String

Error description returned by the OBS server. If Status is smaller than 300, the value is null.

HostId

String

Server ID. If Status is smaller than 300, the value is null.

RequestId

String

Request ID returned by the OBS server. If Status is smaller than 300, the value is null.

InterfaceResult

Object

Result returned after an operation is successfully performed. If Status is smaller than 300, the value is null.

  

RequestId

String

Request ID returned by the OBS server

Others

For details, see Bucket-Related APIs and Object-Related APIs.