diff --git a/backend/src/index.ts b/backend/src/index.ts index 2b584fe7..bac28fcd 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -11,7 +11,7 @@ import { Configs } from "./data/Configs"; // Always use UTC internally // This is also enforced for the database in data/db.ts import moment from "moment-timezone"; -import { Client, TextChannel } from "eris"; +import { Client, DiscordHTTPError, TextChannel } from "eris"; import { connect } from "./data/db"; import { baseGuildPlugins, globalPlugins, guildPlugins } from "./plugins/availablePlugins"; import { errorMessage, isDiscordHTTPError, isDiscordRESTError, MINUTES, successMessage } from "./utils"; @@ -77,6 +77,12 @@ if (process.env.NODE_ENV === "production") { return; } + if (err instanceof DiscordHTTPError && err.code === 500) { + // Don't need stack traces on HTTP 500 errors + console.error(err.message); + return; + } + // tslint:disable:no-console console.error(err);