diff --git a/src/commands/base.ts b/src/commands/base.ts index 13c391d..0754ba2 100644 --- a/src/commands/base.ts +++ b/src/commands/base.ts @@ -212,7 +212,10 @@ export abstract class AbstractCharacterStatusCommand extends SlashCommand { Array.from(names).map((name) => loadCharacter(this.dataDir, name) .then((c) => ({ name, success: true, originalData: c })) - .catch((e) => ({ name, success: false, error: e })) + .catch((e) => { + console.error(`While loading ${name}: `, e) + return { name, success: false, error: e } + }) ) ); } @@ -229,11 +232,6 @@ export abstract class AbstractCharacterStatusCommand extends SlashCommand { } } const loadedCharacters = await this.loadCharacters(neededCharacters); - for (const char of loadedCharacters) { - if (!char.success) { - console.error(`While loading ${char.name}: `, char.error) - } - } const characterMap = new Map(); for (const character of loadedCharacters) { characterMap.set(character.name, character);