diff --git a/app/helpers/static-text.ts b/app/helpers/static-text.ts index 5e6dc82..2c4a544 100644 --- a/app/helpers/static-text.ts +++ b/app/helpers/static-text.ts @@ -88,13 +88,15 @@ export const modsText = { missingManifestAttributesError: (path: string, attributes: string[]) => `Manifest ${path} missing attributes "${attributes.join('", "')}"`, modLoadError: (errors: string[]) => - `Failed to load mod. Errors: ${errors.join(' || ')}`, + `Encountered problems loading the mod: ${errors.join(' || ')}`, actionError: (action: string, error: string) => `Error executing mod ${action}: ${error}`, duplicateModError: (modUniqueName: string) => `Found multiple mods with the same uniqueName (${modUniqueName}). Open the mods directory and make sure you only have one copy of each mod.`, brokenManifestError: (directoryName: string) => `Failed to read manifest.json in mod directory "${directoryName}". Reinstall the mod or contact the mod author to fix this issue.`, + brokenConfigError: (error: string) => + `Failed to read mod configuration files: "${error}"`, }; export const settingsText = { diff --git a/app/services/mod-config.ts b/app/services/mod-config.ts index 66c8677..4869ead 100644 --- a/app/services/mod-config.ts +++ b/app/services/mod-config.ts @@ -1,5 +1,6 @@ import fs from 'fs-extra'; import { debugConsole } from '../helpers/console-log'; +import { modsText } from '../helpers/static-text'; function getDefaultConfigPath(mod: Mod) { return `${mod.modPath}/default-config.json`; @@ -39,7 +40,7 @@ export function getConfig(mod: Mod) { const config: ModConfig = fs.readJsonSync(getConfigPath(mod)); return config; } catch (error) { - debugConsole.error('error trying to get config', error); + mod.errors.push(modsText.brokenConfigError(error)); return undefined; } }