1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2025-01-03 18:35:13 +01:00

Updated errorObject to match TravisCI criteria

This commit is contained in:
michielmulders 2017-09-26 16:19:36 +02:00
parent 6c01d37576
commit 823d340d61

View File

@ -74,11 +74,12 @@ export default function baseRequest(url, { jsonBody, query, urlTemplateSpec, ...
// If status is not a 2xx (based on Response.ok), assume it's an error // If status is not a 2xx (based on Response.ok), assume it's an error
// See https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch // See https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch
if (!(res && res.ok)) { if (!(res && res.ok)) {
throw { let errorObject = {
message: "HTTP Error: Couldn't reach requested webpage", message: 'HTTP Error: Requested page not reachable',
status: res.status + " " + res.statusText, status: '${res.status} ${res.statusText}',
requestURI: res.url requestURI: res.url
} }
throw errorObject
} }
return res return res
}) })