mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-19 02:00:38 +01:00
Cherry-picked: Reject only with Error instead of Object or String Fixes #132
This commit is contained in:
parent
6d30457722
commit
62723d85f0
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ class Core extends EventEmitter {
|
||||||
|
|
||||||
let abortCall = null;
|
let abortCall = null;
|
||||||
this.abortedPromise = new Promise((resolve,reject) => {
|
this.abortedPromise = new Promise((resolve,reject) => {
|
||||||
abortCall = () => reject("Query is finished -- cancelling outstanding promises");
|
abortCall = () => reject(new Error("Query is finished -- cancelling outstanding promises"));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Make sure that if this promise isn't attached to, it doesn't throw a unhandled promise rejection
|
// Make sure that if this promise isn't attached to, it doesn't throw a unhandled promise rejection
|
||||||
|
|
|
@ -80,7 +80,7 @@ class Nadeo extends Core {
|
||||||
|
|
||||||
const sentPromise = new Promise(async (resolve,reject) => {
|
const sentPromise = new Promise(async (resolve,reject) => {
|
||||||
client.methodCall(cmd, params, (err, value) => {
|
client.methodCall(cmd, params, (err, value) => {
|
||||||
if (err) reject('XMLRPC error ' + JSON.stringify(err));
|
if (err) reject(new Error('XMLRPC error ' + JSON.stringify(err)));
|
||||||
resolve(value);
|
resolve(value);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue