From 53bf9cc8b0f72a026f8e5c2f6bd6d9e009d588bb Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 22 Oct 2020 20:20:05 +0100 Subject: [PATCH] Fix error handling --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index f971579..2c93ef0 100644 --- a/index.js +++ b/index.js @@ -76,7 +76,6 @@ class MulticraftAPI { return crypto.createHmac('sha256', this.key).update(signature).digest('hex'); } - // TODO cleanup errors _call(method, params) { // convert to object params = params.reduce((p, v) => { @@ -93,7 +92,7 @@ class MulticraftAPI { form: params }); const data = JSON.parse(res.body); - if (!data.success) return reject(res); + if (!data.success) return reject(data); resolve(data); }) }