All files / src/auxiliary IllegalStateException.ts

100% Statements 6/6
100% Branches 1/1
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1826x           26x     3x 2x 2x 2x          
import { messageCheck, used } from "@jonloucks/contracts-ts/auxiliary/Checks";
 
/**
 * Exception thrown when an operation is invoked at an illegal or inappropriate time. 
 * Note: This can not extend ContractException due to circular dependency.
 */
export class IllegalStateException extends Error {
  constructor(message: string, thrown: Error | null = null) {
    // super(messageCheck(message), thrown || undefined);
    super(messageCheck(message));
    used(thrown);
    this.name = "IllegalStateException";
    Object.setPrototypeOf(this, IllegalStateException.prototype)
  }
}