cordis/exit-codes/exit-codes.ts
2021-11-01 23:29:24 -05:00

17 lines
309 B
TypeScript

import Logger from '../logger/logger';
const LOG = Logger.create('exit');
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);
}
}