1/** 2 * A custom error class that is used to surface a `process.exit` event to a higher 3 * level where it can be tracked through telemetry asynchronously, before exiting. 4 */ 5export class ExitError extends Error { 6 constructor( 7 public cause: string | Error, 8 public code: number 9 ) { 10 super(cause instanceof Error ? cause.message : cause); 11 } 12} 13