From be681c0116fc78b4c2efffc844d672b67a9a9f2a Mon Sep 17 00:00:00 2001 From: Kirill Potekhin Date: Mon, 9 Oct 2017 16:51:33 +0100 Subject: [PATCH] passing receipt data with an error when using promises --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 8f1c6f4..bc60821 100644 --- a/index.js +++ b/index.js @@ -19,8 +19,7 @@ function handlePromisedFunctionCb(resolve, reject) { if (error) { var errorData = { error: error, status: null, message: null }; if (response !== null && typeof response === 'object') { - errorData.status = response.status; - errorData.message = response.message; + Object.assign(errorData, response); } return reject(JSON.stringify(errorData)); }