"use strict"; const axios = require("axios"); const Promise = require("bluebird"); const getJson = require("."); let manualAxios = axios.create(getJson.axiosConfiguration); Promise.try(() => { return manualAxios.get("http://cryto.net/non-existent.json"); // URL does not exist }).then((response) => { let parsedJson = getJson.parse(response); /* throws: BadResponseCode: Got an unexpected HTTP status code (404) */ console.log(parsedJson); });