From 6ad552b7b00978f6759d227e97d98d11e067ceba Mon Sep 17 00:00:00 2001 From: SeanWalsh95 Date: Thu, 5 Nov 2020 11:32:25 -0500 Subject: [PATCH] Descriptive Plugin Error Message error message for the case where a plugin is defined in the config file but does not exist in the codebase --- squad-server/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/squad-server/index.js b/squad-server/index.js index f36c7e2..e505d8c 100644 --- a/squad-server/index.js +++ b/squad-server/index.js @@ -471,6 +471,9 @@ export default class SquadServer extends EventEmitter { for (const pluginConfig of config.plugins) { if (!pluginConfig.enabled) continue; + if (!(pluginConfig.plugin in plugins)) + throw new Error(`Plugin "${pluginConfig.plugin}" in config file is not found.`); + const Plugin = plugins[pluginConfig.plugin]; for (const [optionName, option] of Object.entries(Plugin.optionsSpecification)) {