Skip to content

Commit

Permalink
Switch to more accurate TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
abraham committed Aug 2, 2018
1 parent 388f809 commit 1991595
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Failure<E> {

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

constructor(public data: D) {
if (data === null || data === undefined) {
throw new Error('Parameter "data" is required');
throw new TypeError('Parameter "data" is required');
}
}
}
Expand Down

0 comments on commit 1991595

Please sign in to comment.