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 create DataSourceError from ZodErrors #2166

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Dec 2, 2024

Summary

We now use validation schemas to ensure the incoming Raw<T> responses are as expected as it is "safer" than casting. If validation errors are thrown, however, they are therefore caught and thrown as DataSourceErrors.

This throws any ZodErrors directly, to be caught by the ZodErrorFilter.

Changes

  • Throw ZodErrors directly within methods that parse against schemas.

@iamacook iamacook self-assigned this Dec 2, 2024
@iamacook iamacook requested a review from a team as a code owner December 2, 2024 15:52
@iamacook iamacook merged commit 6491f13 into main Dec 4, 2024
20 checks passed
@iamacook iamacook deleted the zerion-zod-errors branch December 4, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants