8000 Merge branch 'master' into feature/open-current-pr-command · github/VisualStudio@9fc7342 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 9fc7342

Browse files
authored
Merge branch 'master' into feature/open-current-pr-command
2 parents 75b3f93 + af698c5 commit 9fc7342

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/GitHub.InlineReviews/ViewModels/CommentViewModel.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using GitHub.Extensions;
88
using GitHub.Models;
99
using GitHub.UI;
10+
using Octokit;
1011
using ReactiveUI;
1112

1213
namespace GitHub.InlineReviews.ViewModels
@@ -154,7 +155,18 @@ async Task DoCommitEdit(object unused)
154155
}
155156
catch (Exception e)
156157
{
157-
ErrorMessage = e.Message;
158+
var message = e.Message;
159+
160+
if (e is ApiValidationException)
161+
{
162+
// HACK: If the user has pending review comments on the server then we can't
163+
// post new comments. The correct way to test for this would be to make a
164+
// request to /repos/:owner/:repo/pulls/:number/reviews and check for comments
165+
// with a PENDING state. For the moment however we'll just display a message.
166+
message += ". Do you have pending review comments?";
167+
}
168+
169+
ErrorMessage = message;
158170
}
159171
}
160172

0 commit comments

Comments
 (0)
0