From 87062eacd0226f945ab24ad34fbd386caad61464 Mon Sep 17 00:00:00 2001 From: naz_dou <41945483+nduchak@users.noreply.github.com> Date: Mon, 11 Nov 2019 20:36:03 +0700 Subject: [PATCH] feat(Http): Assign error object to http error (#770) --- es/utils/http.js | 2 +- package-lock.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/es/utils/http.js b/es/utils/http.js index 29be9df934..cd9078fd27 100644 --- a/es/utils/http.js +++ b/es/utils/http.js @@ -38,7 +38,7 @@ const processResponse = async (res) => { if (!e.response) throw e throw Object.assign( Error(`Http request for ${e.config.url} failed with status code ${e.response.status}. Status: ${e.response.statusText}. \nError data: ${JSON.stringify(e.response.data)}`), - { data: e.response.data } + { error: e } ) } } diff --git a/package-lock.json b/package-lock.json index ea8ad19a65..4927bd6b91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7710,7 +7710,6 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, - "optional": true, "requires": { "mime-db": "1.40.0" }