Add an exit delay and key

- key 'EXIT_ON_ERROR_DELAY'
This commit is contained in:
Logan Cusano
2023-03-11 21:21:46 -05:00
parent 81851a11b7
commit 06d856e23d

View File

@@ -18,7 +18,7 @@ exports.DebugBuilder = class DebugBuilder {
this.ERROR = (...messageParts) => {
const error = debug(`${appName}:${fileName}:ERROR`);
error(messageParts);
if (process.env.EXIT_ON_ERROR) process.exit();
if (process.env.EXIT_ON_ERROR) setTimeout(process.exit, process.env.EXIT_ON_ERROR_DELAY ?? 0);
}
}
}
}