Catch command line errors and force exit with error code
This commit is contained in:
parent
6aa37eb9e4
commit
50e1b287a9
@ -99,10 +99,20 @@ export default abstract class Application implements Extendable<ApplicationCompo
|
|||||||
await this.init();
|
await this.init();
|
||||||
|
|
||||||
// Process command line
|
// Process command line
|
||||||
if (!this.ignoreCommandLine && await this.processCommandLine()) {
|
if (!this.ignoreCommandLine) {
|
||||||
this.started = true;
|
let result: boolean;
|
||||||
this.busy = false;
|
try {
|
||||||
return;
|
result = await this.processCommandLine();
|
||||||
|
} catch (err) {
|
||||||
|
logger.error(err);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
this.started = true;
|
||||||
|
this.busy = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security
|
// Security
|
||||||
|
Loading…
Reference in New Issue
Block a user