aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/serverLib/MainServer.js
diff options
context:
space:
mode:
authorMinusGix <MinusGix@gmail.com>2019-05-03 10:05:32 +0200
committerGitHub <noreply@github.com>2019-05-03 10:05:32 +0200
commitc7caea8e9bfe1a067535b0e33345050a8ba64143 (patch)
treec33e50687c2803de66c03ecbb0330f0ace7ecf96 /server/src/serverLib/MainServer.js
parentMerge pull request #63 from MinusGix/patch-4 (diff)
downloadhackchat-c7caea8e9bfe1a067535b0e33345050a8ba64143.tar.gz
hackchat-c7caea8e9bfe1a067535b0e33345050a8ba64143.zip
Update MainServer.js
Diffstat (limited to 'server/src/serverLib/MainServer.js')
-rw-r--r--server/src/serverLib/MainServer.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/server/src/serverLib/MainServer.js b/server/src/serverLib/MainServer.js
index c7a4bbe..c55b732 100644
--- a/server/src/serverLib/MainServer.js
+++ b/server/src/serverLib/MainServer.js
@@ -438,9 +438,13 @@ class MainServer extends WsServer {
try {
payload = hooks[i].run(this.core, this, socket, payload);
} catch (err) {
- let errText = `Hook failure, '${type}', '${command}': ${err}`;
- console.log(errText);
- return errText;
+ let errText = `Hook failure, '${type}', '${command}': `;
+ if (this.core.config.logErrDetailed === true) {
+ console.log(errText + err.stack);
+ } else {
+ console.log(errText + err.toString());
+ }
+ return errText + err.toString();
}
// A hook function may choose to return false to prevent all further processing