diff --git a/backend/src/index.ts b/backend/src/index.ts index 9e27b64c..2ab3417c 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -20,6 +20,7 @@ import { startUptimeCounter } from "./uptime"; import { errorMessage, isDiscordAPIError, isDiscordHTTPError, SECONDS, successMessage } from "./utils"; import { loadYamlSafely } from "./utils/loadYamlSafely"; import { DecayingCounter } from "./utils/DecayingCounter"; +import { PluginNotLoadedError } from "knub/dist/plugins/PluginNotLoadedError"; if (!process.env.KEY) { // tslint:disable-next-line:no-console @@ -106,6 +107,13 @@ function errorHandler(err) { return; } + if (err instanceof PluginNotLoadedError) { + // We don't want to crash the bot here, although this *should not happen* + // TODO: Proper system for preventing plugin load/unload race conditions + console.error(err); + return; + } + // tslint:disable:no-console console.error(err);