mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Don't crash on Discord HTTP errors
This commit is contained in:
parent
e585f63bec
commit
be1c327093
1 changed files with 10 additions and 0 deletions
10
src/index.ts
10
src/index.ts
|
@ -6,6 +6,16 @@ process.on("unhandledRejection", (reason, p) => {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on("uncaughtException", err => {
|
||||||
|
if (err.message && err.message.startsWith("DiscordHTTPError")) {
|
||||||
|
console.error(err);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Always use UTC
|
// Always use UTC
|
||||||
// This is also set for the database in knexfile
|
// This is also set for the database in knexfile
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
|
|
Loading…
Add table
Reference in a new issue