From a332a04bed12bce0e4ef406501e474fb30bd1905 Mon Sep 17 00:00:00 2001 From: Jhosbel Aguilar Date: Thu, 16 Dec 2021 21:23:40 -0500 Subject: [PATCH] Make visible response status in the second 'then' --- lib/AvaTaxClient.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/AvaTaxClient.js b/lib/AvaTaxClient.js index 5636129e..7c55084d 100644 --- a/lib/AvaTaxClient.js +++ b/lib/AvaTaxClient.js @@ -102,6 +102,7 @@ export default class AvaTaxClient { return null; } } + res.body.responseStatus = res.status; return res.json(); }).then(json => { // handle error @@ -110,6 +111,7 @@ export default class AvaTaxClient { ex.code = json.error.code; ex.target = json.error.target; ex.details = json.error.details; + ex.responseStatus = json.responseStatus; throw ex; } else { return json;