3
0
Fork 0
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:
Dragory 2018-08-03 19:25:00 +03:00
parent e585f63bec
commit be1c327093

View file

@ -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";