3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Clean up HTTP 500 errors in stderr

This commit is contained in:
Dragory 2020-12-17 03:51:59 +02:00
parent ac7935e24d
commit 785813f495
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

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