Bail and log why if door 'io' config is bad

This commit is contained in:
Bryan Ashby 2022-09-08 21:31:01 -06:00
parent 62bcb8055a
commit 2a0ae05c45
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
2 changed files with 7 additions and 1 deletions

View File

@ -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();

View File

@ -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);