Skip to content

Commit

Permalink
Convert Error to TypeError for some usage issues
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Sep 24, 2016
1 parent cf8fc50 commit 6016457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ function dispatchQueueBatch<K, V>(

// 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<key> and returns Promise<Array<value>>, 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<key> and returns Promise<Array<value>>, but the function did ' +
'not return a Promise of an Array of the same length as the Array ' +
Expand Down

0 comments on commit 6016457

Please sign in to comment.