Skip to content

Commit

Permalink
Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHawkinss committed Oct 22, 2020
1 parent 225b510 commit 53bf9cc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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);
})
}
Expand Down

0 comments on commit 53bf9cc

Please sign in to comment.