Skip to content

Commit 6fab60d

Browse files
committed
don't throw on errors that should not be relocated
1 parent 21dd87d commit 6fab60d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/batch-delegate/src/getLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ function createBatchFn<K = any>(options: BatchDelegateOptions) {
2828
const [pathFieldName, pathNumber] = originalError.path;
2929

3030
if (pathFieldName !== fieldName) {
31-
throw new Error(`Error path value at index 0 should be '${fieldName}', received '${pathFieldName}'.`);
31+
return originalError;
3232
}
3333
const pathNumberType = typeof pathNumber;
3434
if (pathNumberType !== 'number') {
35-
throw new Error(`Error path value at index 1 should be of type number, received '${pathNumberType}'.`);
35+
return originalError;
3636
}
3737

3838
return relocatedError(originalError, originalError.path.slice(0, 0).concat(originalError.path.slice(2)));

0 commit comments

Comments
 (0)