Archived
0
0
Fork 0

fix(logging): made fatal errors exit out of program

This commit is contained in:
Daryl Ronningen 2021-06-19 15:58:20 -07:00
parent c418cbbc90
commit 1ae3f8de10
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
3 changed files with 5 additions and 1 deletions

View file

@ -28,7 +28,7 @@
"run:dev": "NODE_CONFIG_ENV=dev node dist/src/index.js",
"run:prod": "NODE_CONFIG_ENV=production node dist/index.js",
"test": "NODE_CONFIG_ENV=tests mocha -r ts-node/register -r tsconfig-paths/register tests/**/*.test.ts",
"watch:bot": "NODE_CONFIG_ENV=dev nodemon dist/src/index.js --dev",
"watch:bot": "NODE_CONFIG_ENV=dev nodemon dist/src/index.js",
"watch:rollup": "rollup -c --compact --watch",
"watch:tsc": "tsc --watch"
},

View file

@ -48,6 +48,8 @@ if (validate.valid) {
splitMultiline.forEach((val) => {
console.log(chalk`{grey (${date})} {magenta.bold ${ELoggingScope.Startup}} {red.bold.underline [FATAL]}: {red.underline ${val}}`);
});
process.exit(1);
}
figlet('Argon Bot', (err, data) => {

View file

@ -141,4 +141,6 @@ export function fatal(message: string, scope?: ELoggingScope): void {
else
console.log(chalk`{grey (${date})} {red.bold.underline [FATAL]}: {red.underline ${val}}`);
});
process.exit(1);
}