Handling Error Responses

Errors in BBJ are separated into 6 different codes, to allow easy mapping to native exception and signaling systems available in the client's programming language. Errors are all or nothing, there are no "warnings". If a response has a non-false error field, then data will always be null. An error response from the api looks like this...

{
  "error": {
      "code": // an integer from 0 to 5,
      "description": // a string describing the error in detail.
  }
  "data": null   // ALWAYS null if error is not false
  "usermap": {}  // ALWAYS empty if error is not false
}

The codes split errors into categories. Some are oriented to client developers while others should be shown directly to users.