diff --git a/src/sumtype.ts b/src/sumtype.ts index 144c677..0527a2f 100644 --- a/src/sumtype.ts +++ b/src/sumtype.ts @@ -34,7 +34,7 @@ abstract class SumType 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}`); } }