aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/managers/commands.js
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2018-03-14 06:26:53 +0100
committermarzavec <admin@marzavec.com>2018-03-14 06:26:53 +0100
commit39ec02d3c4cb5f5980b172d30404210de2479f0f (patch)
treeb837c9cfff94c62aa3de9880e4f7d07460734984 /server/src/managers/commands.js
parentstabilized modules and server cmd field (diff)
downloadhackchat-39ec02d3c4cb5f5980b172d30404210de2479f0f.tar.gz
hackchat-39ec02d3c4cb5f5980b172d30404210de2479f0f.zip
Streamlined modules, server tweaks, better feedback
Diffstat (limited to '')
-rw-r--r--server/src/managers/commands.js11
1 files changed, 4 insertions, 7 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({