From 27ad9984d4847c080e60268a4aedf5ae05ce870f Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 24 Mar 2021 20:49:54 +0100 Subject: [PATCH] [core] Minor cleanup / fixed typo --- src/boot/plugins.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/boot/plugins.ts b/src/boot/plugins.ts index 06e1444..c070353 100644 --- a/src/boot/plugins.ts +++ b/src/boot/plugins.ts @@ -331,7 +331,7 @@ export default boot(async ({ router, app }) => { const pluginsContext = require.context('src/plugins', true, /.+\/plugin.ts$/); // Start loading plugins - // Load required modules: + // Load required modules, if not found or error when loading this will forward the user to the error page config.requiredModules.forEach((required) => { const plugin = loadPlugin(loadedPlugins, required, pluginsContext, backend); if (!plugin) { @@ -341,6 +341,7 @@ export default boot(async ({ router, app }) => { }); // Load user defined plugins + // If there is an error with loading a plugin, the user will get informed. const failed: string[] = []; config.loadModules.forEach((required) => { const plugin = loadPlugin(loadedPlugins, required, pluginsContext, backend); @@ -349,11 +350,13 @@ export default boot(async ({ router, app }) => { } }); if (failed.length > 0) { + // Log failed plugins console.error('Could not load all plugins', failed); + // Inform user about error Notify.create({ type: 'negative', message: - 'Fehler beim laden, nicht alle Funktionen stehen zur Verfügung. Bitte wende dich an den Admin!', + 'Fehler beim Laden: Nicht alle Funktionen stehen zur Verfügung. Bitte wende dich an den Admin!', timeout: 10000, progress: true, });