Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KiiErrorParser

A Parser for error string or error object returned by SDK.

Hierarchy

  • KiiErrorParser

Index

Methods

Methods

  • parse(error: any): any
  • Parse an error string or error object returned by SDK.

    example
    let err = KiiErrorParser.parse(errorString);
    let 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
    }
    let errorCode = err.code;
    let errorMessage = err.message;

    Parameters

    • error: any

      An error string or error object

    Returns any

    return parsed error object.

Generated using TypeDoc