Add error handling for malfoemed author#1935
Merged
finswimmer merged 3 commits intoJun 26, 2020
Merged
Conversation
3 tasks
finswimmer
requested changes
Jun 23, 2020
Comment on lines
+165
to
+171
| if m is None: | ||
| logger.warning( | ||
| "Invalid author string. Must be in the format: " | ||
| "John Smith <john@example.com>" | ||
| ) | ||
| return {"name": None, "email": None} | ||
|
|
Member
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
@finswimmer
Thanks for the review!
I have fixed. 6a0ac4a
3 tasks
3ca7541 to
6a0ac4a
Compare
malcolmgreaves
pushed a commit
to malcolmgreaves/pyprocut
that referenced
this pull request
Jul 1, 2020
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
developbranch. If it's a bug fix or only a documentation update, it should be based on themasterbranch.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.