Class

APIError

APIError(status, message)

APIError wraps CloudBlue Connect API errors. Provides convenient methods to obtains error code and error messages. The Cloud Blue Connect JSON error looks like:

Constructor

# new APIError(status, message)

Create a new instance of the APIError class.

Parameters:
Name Type Description
status number

the http status code.

message string

A JSON parseable object.

Example
{
   "error_code": "SYS_001",
   "errors": [
      "error message 1"
   ]
}

Extends

Members

# errorCode

Returns the error code.

# errors

Returns an array of error messages.

# json

Returns the JSON error object.

number

# status

The http status code.

Overrides: