Class Index | File Index

Classes


Class KiiErrorParser

A Parser for error string or error object returned by SDK.
Defined in: KiiSDK.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
KiiErrorParser.parse(error)
Parse an error string or error object returned by SDK.
Class Detail
KiiErrorParser()
Method Detail
<static> {Object} KiiErrorParser.parse(error)
Parse an error string or error object returned by SDK.
  var err = KiiErrorParser.parse(errorString);
  var httpStatus = err.status;
  if (httpStatus == 0) {
      // NetworkError
  } else if (httpStatus == -1) {
      // Error is not related the http error. eg. argument error, illegal state error, etc.
  } else if (httpStatus == -2) {
      // Unknown error is detected.
      // Please confirm that you are using the latest version of SDK.
  } else if (httpStatus >= 400 && httpStatus < 600) {
      // Http error
  }
  var errorCode = err.code;
  var errorMessage = err.message;
Parameters:
{Object} error
An error string or error object
Returns:
{Object} return parsed error object.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Sep 15 2021 05:31:33 GMT-0000 (UTC)