Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exit(message: string | Error | null = null, code: number = 1): this {
const error = new ExitError(this.msg('errors:processTerminated'), code);
if (message) {
if (instanceOf(message, Error)) {
error.message = message.message;
error.stack = message.stack;
} else {
error.message = message;
}
}
throw error;
}