From 6c01d375768d46d16486449835e230595dfa9412 Mon Sep 17 00:00:00 2001 From: michielmulders Date: Tue, 26 Sep 2017 16:05:25 +0200 Subject: [PATCH] Solved throw payload message at baserequest --- src/baseRequest.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/baseRequest.js b/src/baseRequest.js index e75e92a..0b5a829 100644 --- a/src/baseRequest.js +++ b/src/baseRequest.js @@ -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 })