Skip to content

Commit

Permalink
Merge pull request #5 from hojberg/use_error_obj
Browse files Browse the repository at this point in the history
Use an Error when throwing for incomplete pattern
  • Loading branch information
hojberg authored Feb 24, 2019
2 parents d93a38b + 1c926e5 commit 54ddfd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sumtype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class SumType<M extends Variants> implements Setoid, Show {
} else if (pattern._) {
return pattern._();
} else {
throw `caseOf pattern is missing a function for ${this.kind}`;
throw new Error(`caseOf pattern is missing a function for ${this.kind}`);
}
}

Expand Down

0 comments on commit 54ddfd6

Please sign in to comment.