Skip to content

Commit

Permalink
Merge pull request #26 from abraham/type-error
Browse files Browse the repository at this point in the history
Switch to more accurate TypeError
  • Loading branch information
abraham authored Aug 2, 2018
2 parents 388f809 + 1991595 commit 30bb8db
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 30bb8db

Please sign in to comment.