diff options
Diffstat (limited to 'server/src/managers')
-rw-r--r-- | server/src/managers/commands.js | 11 | ||||
-rw-r--r-- | server/src/managers/config.js | 6 |
2 files changed, 6 insertions, 11 deletions
diff --git a/server/src/managers/commands.js b/server/src/managers/commands.js index 95d0f1b..569206d 100644 --- a/server/src/managers/commands.js +++ b/server/src/managers/commands.js @@ -17,7 +17,7 @@ class CommandManager { /** * Create a `CommandManager` instance for handling commands/protocol * - * @param {Object} core reference to the global core object + * @param {Object} core Reference to the global core object */ constructor (core) { this.core = core; @@ -57,8 +57,7 @@ class CommandManager { let error = this._validateCommand(command); if (error) { - // TODO: Add to logger? - let errText = `Failed to load '${name}': ${error}\n\n`; + let errText = `Failed to load '${name}': ${error}`; console.log(errText); return errText; } @@ -82,8 +81,7 @@ class CommandManager { try { command.init(this.core); } catch (err) { - // TODO: Add to logger? - let errText = `Failed to initialize '${name}': ${err}\n\n`; + let errText = `Failed to initialize '${name}': ${err}`; console.log(errText); return errText; } @@ -227,8 +225,7 @@ class CommandManager { try { return await command.run(this.core, server, socket, data); } catch (err) { - // TODO: Add to logger? - let errText = `Failed to execute '${command.info.name}': ${err}\n\n`; + let errText = `Failed to execute '${command.info.name}': ${err}`; console.log(errText); server.reply({ diff --git a/server/src/managers/config.js b/server/src/managers/config.js index 2ff4a88..1848cac 100644 --- a/server/src/managers/config.js +++ b/server/src/managers/config.js @@ -202,10 +202,8 @@ class ConfigManager { fse.removeSync(backupPath); return true; - } catch (e) { - // TODO: restore backup - // TODO: output to logging engine? - console.log('Failed to save config file!'); + } catch (err) { + console.log(`Failed to save config file: ${err}`); return false; } |