How to use the @boost/internal.ExitError function in @boost/internal

To help you get started, we’ve selected a few @boost/internal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github milesj / boost / packages / core / src / Tool.ts View on Github external
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;
  }