diff --git a/src/index.ts b/src/index.ts index a311716..10ab3c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,7 +20,7 @@ export class Failure { constructor(public error: E) { if (error === null || error === undefined) { - throw new Error('Parameter "error" is required'); + throw new TypeError('Parameter "error" is required'); } } } @@ -30,7 +30,7 @@ export class Success { constructor(public data: D) { if (data === null || data === undefined) { - throw new Error('Parameter "data" is required'); + throw new TypeError('Parameter "data" is required'); } } }