From 15d05c7f0130f6ed2cf3c454d34d18f9cf963477 Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Wed, 27 Oct 2021 01:58:08 +0200 Subject: [PATCH] :zap: Fixed ignore response code flag to work properly with return full response (#2370) --- packages/core/src/NodeExecuteFunctions.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index 9aa1cf3e8d..6ef54f37ac 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -438,17 +438,17 @@ async function proxyRequestToAxios( } }) .catch((error) => { - if (configObject.simple === true && error.response) { - resolve({ - body: error.response.data, - headers: error.response.headers, - statusCode: error.response.status, - statusMessage: error.response.statusText, - }); - return; - } if (configObject.simple === false && error.response) { - resolve(error.response.data); + if (configObject.resolveWithFullResponse) { + resolve({ + body: error.response.data, + headers: error.response.headers, + statusCode: error.response.status, + statusMessage: error.response.statusText, + }); + } else { + resolve(error.response.data); + } return; }