1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-11-22 09:46:58 +01:00

Solved throw payload message at baserequest

This commit is contained in:
michielmulders 2017-09-26 16:05:25 +02:00
parent f2fbdc79ce
commit 6c01d37576

View File

@ -74,7 +74,11 @@ export default function baseRequest(url, { jsonBody, query, urlTemplateSpec, ...
// 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
if (!(res && res.ok)) {
throw res
throw {
message: "HTTP Error: Couldn't reach requested webpage",
status: res.status + " " + res.statusText,
requestURI: res.url
}
}
return res
})