mirror of
https://github.com/danbulant/Shasha
synced 2026-05-24 12:22:00 +00:00
log errors to console
This commit is contained in:
parent
d1d6dd6b98
commit
fe2a2e53a4
1 changed files with 21 additions and 5 deletions
26
Main.js
26
Main.js
|
|
@ -198,15 +198,31 @@ client.on("commandRun", async (c, u, msg) => {
|
||||||
if (msg.guild && !msg.guild.DB) await msg.guild.dbLoad();
|
if (msg.guild && !msg.guild.DB) await msg.guild.dbLoad();
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on("warn", a => console.log("warn", typeof a, a));
|
client.on("warn", e => {
|
||||||
client.on("error", e => errLog(e, null, client));
|
console.error(e);
|
||||||
|
errLog(e, null, client);
|
||||||
|
});
|
||||||
|
client.on("error", e => {
|
||||||
|
console.error(e);
|
||||||
|
errLog(e, null, client);
|
||||||
|
});
|
||||||
client.on("commandError", (c, e, m) => {
|
client.on("commandError", (c, e, m) => {
|
||||||
|
console.error(e);
|
||||||
errLog(e, m, client);
|
errLog(e, m, client);
|
||||||
m?.channel.stopTyping();
|
m?.channel.stopTyping();
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on("uncaughtException", e => errLog(e, null, client));
|
process.on("uncaughtException", e => {
|
||||||
process.on("unhandledRejection", e => errLog(e, null, client));
|
console.error(e);
|
||||||
process.on("warning", e => errLog(e, null, client));
|
errLog(e, null, client);
|
||||||
|
});
|
||||||
|
process.on("unhandledRejection", e => {
|
||||||
|
console.error(e);
|
||||||
|
errLog(e, null, client);
|
||||||
|
});
|
||||||
|
process.on("warning", e => {
|
||||||
|
console.error(e);
|
||||||
|
errLog(e, null, client);
|
||||||
|
});
|
||||||
|
|
||||||
client.login(configFile.token);
|
client.login(configFile.token);
|
||||||
Loading…
Reference in a new issue