From c7caea8e9bfe1a067535b0e33345050a8ba64143 Mon Sep 17 00:00:00 2001 From: MinusGix Date: Fri, 3 May 2019 03:05:32 -0500 Subject: [PATCH] Update MainServer.js --- server/src/serverLib/MainServer.js | 10 +++++++--- 1 file 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