Error Response-type

An Error response is returned whenever a Server Error has occurred. On the transport level, the Error response-type is combined with a HTTP status code from the Server Error range (500-599).

Required keys

  • status: Will always be set to “error”.
  • message: A meaningful, end-user-readable (or at the least log-worthy) message, explaining what went wrong.

Optional keys

  • code: A numeric code corresponding to the error, if applicable
  • data: Generic container for any other information about the error, i.e. the conditions that caused the error, stack traces, etc.

An example Error response is:

{
  "status": "error",
  "message": "Unable to communicate with database"
}