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

Improve error message for NameEmail #6939

Merged
merged 1 commit into from Aug 16, 2023
Merged

Improve error message for NameEmail #6939

merged 1 commit into from Aug 16, 2023

Conversation

dmontagu
Copy link
Contributor

@dmontagu dmontagu commented Jul 28, 2023

Discovered while looking into #6897 (comment)

Selected Reviewer: @Kludex

Comment on lines +826 to +828
assert exc_info.value.errors() == [
{'input': 1, 'loc': ('v',), 'msg': 'Input is not a valid NameEmail', 'type': 'name_email_type'}
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On current main branch, you get:

[{'ctx': {'class': 'NameEmail'},
  'input': 1,
  'loc': ('v', 'is-instance[NameEmail]'),
  'msg': 'Input should be an instance of NameEmail',
  'type': 'is_instance_of',
  'url': 'https://errors.pydantic.dev/2.1/v/is_instance_of'},
 {'input': 1,
  'loc': ('v', 'str'),
  'msg': 'Input should be a valid string',
  'type': 'string_type',
  'url': 'https://errors.pydantic.dev/2.1/v/string_type'}]

@cloudflare-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1d6888e
Status: ✅  Deploy successful!
Preview URL: https://87af06da.pydantic-docs2.pages.dev
Branch Preview URL: https://fix-name-email-error.pydantic-docs2.pages.dev

View logs

@dmontagu
Copy link
Contributor Author

please review

@adriangb adriangb merged commit 7908718 into main Aug 16, 2023
49 checks passed
@adriangb adriangb deleted the fix-name-email-error branch August 16, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants