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, });