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

fix: don't blindly suppress ValueError #450

Merged
merged 2 commits into from
Dec 8, 2023
Merged

Conversation

guacs
Copy link
Member

@guacs guacs commented Dec 8, 2023

Pull Request Checklist

  • New code has 100% test coverage
  • (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
  • (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
  • Pre-Commit Checks were ran and passed
  • Tests were ran and passed

Description

The suppressing of ValueError even when it's raised from get_constrained_collection or get_constrained_dict causes the exception to be thrown to be misleading. This fixes that by only catching the ValueError if it was raised from get_collection_type.

Close Issue(s)

@guacs guacs enabled auto-merge (squash) December 8, 2023 11:23
Copy link

sonarcloud bot commented Dec 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@guacs guacs merged commit 6961eaa into main Dec 8, 2023
21 checks passed
@guacs guacs deleted the raise-correct-exception branch December 8, 2023 11:27
Copy link

github-actions bot commented Dec 8, 2023

Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/450

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.

incorrect exception raised when nested model validation fails
3 participants