Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't throw on errors that should not be relocated #3136

Merged
merged 1 commit into from
Jul 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/batch-delegate/src/getLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ function createBatchFn<K = any>(options: BatchDelegateOptions) {
const [pathFieldName, pathNumber] = originalError.path;

if (pathFieldName !== fieldName) {
throw new Error(`Error path value at index 0 should be '${fieldName}', received '${pathFieldName}'.`);
return originalError;
}
const pathNumberType = typeof pathNumber;
if (pathNumberType !== 'number') {
throw new Error(`Error path value at index 1 should be of type number, received '${pathNumberType}'.`);
return originalError;
}

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