Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit af698c5

Browse files
authored
Merge pull request #1123 from github/fixes/1044-pending-review-comments
Add message for pending review comments.
2 parents c502cf8 + 24778dc commit af698c5

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)