Skip to content

Commit

Permalink
Now correctly recognized as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
galaxine-senpai committed Mar 13, 2024
1 parent f5afcc6 commit 054969b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/utils/getOnlinePlayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
};
2 changes: 1 addition & 1 deletion src/utils/getPlayerQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
};
2 changes: 1 addition & 1 deletion src/utils/getServerBans.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getServerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
};
2 changes: 1 addition & 1 deletion src/utils/getServerKL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
};
2 changes: 1 addition & 1 deletion src/utils/runCmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
};

0 comments on commit 054969b

Please sign in to comment.