Skip to content

Match github.com empty comment behavior (Fixes #587)#588

Merged
rebornix merged 5 commits intomicrosoft:masterfrom
mmanela:emptyCommentErrorHandling
Oct 22, 2018
Merged

Match github.com empty comment behavior (Fixes #587)#588
rebornix merged 5 commits intomicrosoft:masterfrom
mmanela:emptyCommentErrorHandling

Conversation

@mmanela
Copy link

@mmanela mmanela commented Oct 18, 2018

When you submit a comment and only give new lines it gives a misleading error message.

image

This PR (fixes #587) contains a small change to match the error behavior that GitHub.com uses in this case
image

I also added some types for the error object. I looked in the octokit typings and didn't see something there. This is my first time contributing to this repo so please let me know if I am missing or need to change anything.

Thanks for the awesome extension.

@rebornix rebornix self-assigned this Oct 22, 2018
@rebornix
Copy link
Member

It looks to me in overall. I pushed a commit to fix tslint errors but left a tiny comment for JSON.parse. Once that's fixed we can have it merged. Thanks for your help!

// since it will have a more useful stack
throw e;
}
const firstError = errorObject && errorObject.errors && errorObject.errors[0];
Copy link
Member

Choose a reason for hiding this comment

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

👍

@rebornix rebornix merged commit c34b833 into microsoft:master Oct 22, 2018
@rebornix
Copy link
Member

LGTM. Thanks again for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading error message when submitting empty comment

2 participants