diff --git a/src/utils/getOnlinePlayers.js b/src/utils/getOnlinePlayers.js index d031a84..4c5b052 100644 --- a/src/utils/getOnlinePlayers.js +++ b/src/utils/getOnlinePlayers.js @@ -13,7 +13,7 @@ module.exports = (token) => { "Server-Key": globalConfig.token, }, }); - if (r.status !== 200) return reject("API Returned: " + r.status); + if (r.status !== 200) return reject(new Error("[getOnlinePlayers] API Returned: " + r.status)); else return resolve(r.json()); }); }; diff --git a/src/utils/getPlayerQueue.js b/src/utils/getPlayerQueue.js index 6fb7b4d..6aa7a56 100644 --- a/src/utils/getPlayerQueue.js +++ b/src/utils/getPlayerQueue.js @@ -13,7 +13,7 @@ module.exports = (token) => { "Server-Key": globalConfig.token, }, }); - if (r.status !== 200) return reject("API Returned: " + r.status); + if (r.status !== 200) return reject(new Error("[getPlayerQueue] API Returned: " + r.status)); else return resolve(r.json()); }); }; diff --git a/src/utils/getServerBans.js b/src/utils/getServerBans.js index 88b7743..a2f1cb4 100644 --- a/src/utils/getServerBans.js +++ b/src/utils/getServerBans.js @@ -14,7 +14,7 @@ module.exports = async (token) => { "Server-Key": globalConfig.token, }, }); - if (r.status !== 200) return reject("API Returned: " + r.status); + if (r.status !== 200) return reject(new Error("[getServerBans] API Returned: " + r.status)); else return resolve(r.json()); } catch (error) { return reject("API Error: " + error.message); diff --git a/src/utils/getServerInfo.js b/src/utils/getServerInfo.js index 19f8c63..7e590ab 100644 --- a/src/utils/getServerInfo.js +++ b/src/utils/getServerInfo.js @@ -13,7 +13,7 @@ module.exports = (token) => { "Server-Key": globalConfig.token, }, }); - if (r.status !== 200) return reject("API Returned: " + r.status); + if (r.status !== 200) return reject(new Error("[getServerInfo] API Returned: " + r.status)); else return resolve(r.json()); }); }; \ No newline at end of file diff --git a/src/utils/getServerKL.js b/src/utils/getServerKL.js index 995f098..5d31afe 100644 --- a/src/utils/getServerKL.js +++ b/src/utils/getServerKL.js @@ -13,7 +13,7 @@ module.exports = (token) => { "Server-Key": globalConfig.token, }, }); - if (r.status !== 200) return reject("API Returned: " + r.status); + if (r.status !== 200) return reject(new Error("[getServerKL] API Returned: " + r.status)); else return resolve(r.json()); }); }; diff --git a/src/utils/runCmd.js b/src/utils/runCmd.js index a96b580..4ea236d 100644 --- a/src/utils/runCmd.js +++ b/src/utils/runCmd.js @@ -17,7 +17,7 @@ module.exports = (token, cmd) => { command: cmd, }), }); - if (r.status !== 200) return reject("API Returned: " + r.status); + if (r.status !== 200) return reject(new Error("[runCmd.js] API Returned: " + r.status)); else return resolve(r.json()); }); };