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

Posting response when there are no Todos to pop instead of unkown error #105

Conversation

dantepippi
Copy link
Contributor

This PR fixes issue 92 posting a response message when there are no Todos to pop instead of unkown error.
closes #92

@dantepippi dantepippi requested a review from larkox as a code owner July 24, 2020 17:41
@hanzei hanzei added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Jul 24, 2020
@larkox larkox requested a review from hanzei July 27, 2020 11:27
Copy link
Contributor

@larkox larkox left a 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! 🎉

Copy link
Contributor

@hanzei hanzei left a 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" {
Copy link
Contributor

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.

@hanzei hanzei removed the 2: Dev Review Requires review by a core committer label Jul 27, 2020
@hanzei hanzei requested a review from DHaussermann July 27, 2020 12:25
@hanzei
Copy link
Contributor

hanzei commented Jul 27, 2020

@DHaussermann Mind skipping QA review as this is a beta plugin?

Copy link

@DHaussermann DHaussermann left a 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!

@DHaussermann DHaussermann added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels Jul 29, 2020
@larkox larkox merged commit ffa4359 into mattermost-community:master Jul 29, 2020
@larkox larkox mentioned this pull request Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pop command throws an "unkwon error" when no todos in the list
4 participants