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 18 19 20 21 22 | 38x 14x 1x 13x 38x 44x 44x 38x 38x 3x | export const getErrorOrThrow = (err: unknown): Error|SiError => { if (!(err instanceof Error) && !(err instanceof SiError)) { throw new Error('Thrown thing is not an error'); } return err; }; export class SiError { // eslint-disable-next-line no-useless-constructor constructor( public message: string = '', public stack = [], // eslint-disable-next-line no-empty-function ) {} } export class NotImplementedError extends SiError {} export const notImplemented = (message?: string): never => { throw new NotImplementedError(message || 'Not implemented'); }; |