mirror of
https://github.com/hack-chat/main.git
synced 2024-03-22 13:20:33 +08:00
Merge pull request #64 from MinusGix/patch-5
Extend logErrDetailed configuration option to errors when calling a hook
This commit is contained in:
commit
67dca7090f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user