Skip to content

Commit 1991595

Browse files
committed
Switch to more accurate TypeError
1 parent 388f809 commit 1991595

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class Failure<E> {
2020

2121
constructor(public error: E) {
2222
if (error === null || error === undefined) {
23-
throw new Error('Parameter "error" is required');
23+
throw new TypeError('Parameter "error" is required');
2424
}
2525
}
2626
}
@@ -30,7 +30,7 @@ export class Success<D> {
3030

3131
constructor(public data: D) {
3232
if (data === null || data === undefined) {
33-
throw new Error('Parameter "data" is required');
33+
throw new TypeError('Parameter "data" is required');
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)