From 1991595b4e2d19132d700daf133a8c9f359ca820 Mon Sep 17 00:00:00 2001 From: Abraham Williams <4braham@gmail.com> Date: Thu, 2 Aug 2018 11:45:58 -0500 Subject: [PATCH] Switch to more accurate TypeError --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index a311716..10ab3c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,7 +20,7 @@ export class Failure { constructor(public error: E) { if (error === null || error === undefined) { - throw new Error('Parameter "error" is required'); + throw new TypeError('Parameter "error" is required'); } } } @@ -30,7 +30,7 @@ export class Success { constructor(public data: D) { if (data === null || data === undefined) { - throw new Error('Parameter "data" is required'); + throw new TypeError('Parameter "data" is required'); } } }