All files / lib errors.ts

20% Statements 2/10
0% Branches 0/1
0% Functions 0/3
20% Lines 2/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21                        1x               1x
export class Exception extends Error {
  public name: string;
  public stack: string;

  constructor(public message: string) {
    super(message);
    this.name = 'Exception';
    this.stack = (<any>new Error()).stack;
  }

  public toString() {
    return `${this.name}: ${this.message}`;
  }
}

export class FatalException extends Exception {
  constructor(public message: string, public exitCode: number = 1) {
    super(message);
  }
}