-
Notifications
You must be signed in to change notification settings - Fork 64
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
Posting response when there are no Todos to pop instead of unkown error #105
Posting response when there are no Todos to pop instead of unkown error #105
Conversation
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.
LGTM. Thank you very much for the contribution! 🎉
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.
One none blocking comment on code design. Thanks for the contribution 👍
@@ -216,6 +216,10 @@ func (p *Plugin) runListCommand(args []string, extra *model.CommandArgs) (bool, | |||
func (p *Plugin) runPopCommand(args []string, extra *model.CommandArgs) (bool, error) { | |||
issue, foreignID, err := p.listManager.PopIssue(extra.UserId) | |||
if err != nil { | |||
if err.Error() == "cannot find issue" { |
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.
The idiomatic way would be to define an error type e.g. ItemNotFound
and check for it here using error.Is
.
@DHaussermann Mind skipping QA review as this is a beta plugin? |
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.
Yes @hanzei this would be fine to merge.
Reviewed code change and added an explicit test for this to release testing. This will be covered on the next version bump PR.
LGTM!
Thanks @dantepippi fir fixing this!
This PR fixes issue 92 posting a response message when there are no Todos to pop instead of unkown error.
closes #92