Errors

Damn it. What happened now?

HTTP Errors

Here is a list of the most common HTTP errors you'll encounter. All errors return in a JSON format. In addition to returning the HTTP status codes, we also return an error message. There are different error types that are specific to certain use cases in the API.

The errors come in this format:

{
    "code": <status code>,
    "message": <A short message regarding the error>,
    "description": <A generic description of the error>,
    "error": {
        "type": <The error type above>,
        "exception_description": <A more specific error description>
        }
}

The description in the returned errors may vary slightly between different API calls.

builton.products.get('58ab022id0n7ex1st3045dbf').then((product) => {
  console.log(product);
}).catch((err) => {
  console.error(err.response.body);
  /*
    {
      code: 404,
      message: 'Getting product failed.',
      description: 'getting product:58ab022id0n7ex1st3045dbf failed',
      error: 
       { type: 'DoesNotExist',
         exception_description: 'the Product with id: \'58ab022id0n7ex1st3045dbf\' does not exist',
         params: '58ab022id0n7ex1st3045dbf'
       }
    }
  */
});

Last updated