From 2a0ae05c4505781c743997e8dca918a930b6711e Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 8 Sep 2022 21:31:01 -0600 Subject: [PATCH] Bail and log why if door 'io' config is bad --- core/abracadabra.js | 6 +++++- core/door.js | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/abracadabra.js b/core/abracadabra.js index 2a9dd035..71338ac1 100644 --- a/core/abracadabra.js +++ b/core/abracadabra.js @@ -196,7 +196,11 @@ exports.getModule = class AbracadabraModule extends MenuModule { const doorTracking = trackDoorRunBegin(this.client, this.config.name); - this.doorInstance.run(exeInfo, () => { + this.doorInstance.run(exeInfo, err => { + if (err) { + Log.error(`Error running "${this.config.name}": ${err.message}`); + } + trackDoorRunEnd(doorTracking); this.decrementActiveDoorNodeInstances(); diff --git a/core/door.js b/core/door.js index 305ae162..800292fc 100644 --- a/core/door.js +++ b/core/door.js @@ -58,6 +58,8 @@ module.exports = class Door { if ('socket' === this.io && !this.sockServer) { return cb(Errors.UnexpectedState('Socket server is not running')); + } else if ('stdio' !== this.io) { + return cb(Errors.Invalid(`"${this.io}" is not a valid io type!`)); } const cwd = exeInfo.cwd || paths.dirname(exeInfo.cmd);