Skip to content

Commit 53bf9cc

Browse files
committed
Fix error handling
1 parent 225b510 commit 53bf9cc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ class MulticraftAPI {
7676
return crypto.createHmac('sha256', this.key).update(signature).digest('hex');
7777
}
7878

79-
// TODO cleanup errors
8079
_call(method, params) {
8180
// convert to object
8281
params = params.reduce((p, v) => {
@@ -93,7 +92,7 @@ class MulticraftAPI {
9392
form: params
9493
});
9594
const data = JSON.parse(res.body);
96-
if (!data.success) return reject(res);
95+
if (!data.success) return reject(data);
9796
resolve(data);
9897
})
9998
}

0 commit comments

Comments
 (0)