-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add error handling for malfoemed author #1935
Add error handling for malfoemed author #1935
Conversation
poetry/packages/package.py
Outdated
if m is None: | ||
logger.warning( | ||
"Invalid author string. Must be in the format: " | ||
"John Smith <[email protected]>" | ||
) | ||
return {"name": None, "email": None} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @yamagen0915,
thanks a lot for your contribution!
I think instead of just returning None values, we should raise a ValueError with your descriptive message. I'm afraid many users will not read the console output and will wonder why their author isn't in the metadata. So we should follow the principal of "fail fast".
fin swimmer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@finswimmer
Thanks for the review!
I have fixed. 6a0ac4a
3ca7541
to
6a0ac4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍 Thanks a lot.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!
Note: If your Pull Request introduces a new feature or changes the current behavior, it should be based
on the
develop
branch. If it's a bug fix or only a documentation update, it should be based on themaster
branch.If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
Issue
Fixes #1143.
In my case, I got the same error when I set empty string on author.
I just fixed for now to return None.
Please tell me another approach if this is not appropriate fix.