cordis/exit-codes/exit-codes.ts

17 lines
309 B
TypeScript
Raw Normal View History

2021-10-30 17:26:41 +00:00
import Logger from '../logger/logger';
2021-11-02 04:29:24 +00:00
const LOG = Logger.create('exit');
2021-10-30 17:26:41 +00:00
export enum ExitCode {
SUCCESS = 0,
GENERAL_ERROR = 1,
IO_ERROR = 2,
DB_ERROR = 3,
};
export class ExitCodes {
static exit(code: ExitCode) {
LOG.info(`exiting with code ${code}: ${ExitCode[code]}`);
process.exit(code);
}
}