From 601645795009d06ea1a94ee6b44fe848f6eeb4f3 Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Fri, 23 Sep 2016 17:20:18 -0700 Subject: [PATCH] Convert Error to TypeError for some usage issues --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 2cad3e6..40a2337 100644 --- a/src/index.js +++ b/src/index.js @@ -262,14 +262,14 @@ function dispatchQueueBatch( // Assert the expected resolution from batchLoadFn. if (!Array.isArray(values)) { - throw new Error( + throw new TypeError( 'DataLoader must be constructed with a function which accepts ' + 'Array and returns Promise>, but the function did ' + `not return a Promise of an Array: ${String(values)}.` ); } if (values.length !== keys.length) { - throw new Error( + throw new TypeError( 'DataLoader must be constructed with a function which accepts ' + 'Array and returns Promise>, but the function did ' + 'not return a Promise of an Array of the same length as the Array ' +