[core] Minor cleanup / fixed typo

This commit is contained in:
Ferdinand Thiessen 2021-03-24 20:49:54 +01:00
parent fb2febdadd
commit 27ad9984d4
1 changed files with 5 additions and 2 deletions

View File

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