Methods
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference.
If problems occur when using the OBS BrowserJS SDK, you can perform the following steps to analyze and locate the problems.
- Make sure that the OBS BrowserJS SDK is the latest version. Click here to download the latest version.
- Make sure that the program code of the OBS BrowserJS SDK complies with General Examples of ObsClient. All ObsClient APIs are processed with exception handling. The following is an example code of uploading an object:
// Create an instance of ObsClient. var obsClient = new ObsClient({ access_key_id: '*** Provide your Access Key ***', secret_access_key: '*** Provide your Secret Key ***', server : 'https://your-endpoint' }); obsClient.putObject({ Bucket : 'bucketname', Key : 'objectname', Body : 'Hello OBS' }, function (err, result) { if(err){ // If the exception information is not null, it indicates that an error occurs when the API is called. The common cause is network exception. console.error('Error-->' + err); }else{ //If the exception information is null, the API call is complete. Check the HTTP status code using the SDK common result objects. if(result.CommonMsg.Status < 300){// If the HTTP status code is less than 300, and the API call is successful. if(result.InterfaceResult){ // Process the business logic after the call is successful. // Optional: After the API is successfully called, record the HTTP status code and request ID returned by the server. console.log('Status-->' + result.CommonMsg.Status); console.log('RequestId-->' + result.CommonMsg.RequestId); } }else{ // Recommended: If the call fails, record the HTTP status code, server-side error code, and request ID returned by the server. console.log('Status-->' + result.CommonMsg.Status); console.log('Code-->' + result.CommonMsg.Code); ; console.log('RequestId-->' + result.CommonMsg.RequestId); } } }); - If the exception information is not null, check the network between the client and the OBS server. If the network is normal, collect the exception information and contact the OBS client O&M team to locate the cause of the exception.
- If an ObsClient API call fails, obtain the HTTP status code and OBS server-side error code from the SDK common result objects, and compare them to locate the cause.
- If the cause cannot be found in step 4, obtain the request ID returned by the OBS server from the SDK common result objects and contact the OBS server O&M team to locate the cause.
- If the request ID cannot be obtained from the SDK common result objects, contact the OBS client O&M team to locate the failure cause.
Last Article: Fault Locating
Next Article: Notable Issues

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.