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

Commit c14da9b

Browse files
authored
Merge pull request #464 from github/fixes/453-descriptive-errors
Descriptive Pull Request Creation Errors
2 parents 380cb56 + 75ce12e commit c14da9b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/GitHub.App/ViewModels/PullRequestCreationViewModel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using GitHub.Extensions;
1414
using NullGuard;
1515
using GitHub.App;
16+
using Octokit;
1617

1718
namespace GitHub.ViewModels
1819
{
@@ -75,7 +76,10 @@ public PullRequestCreationViewModel(IRepositoryHost repositoryHost, ISimpleRepos
7576
{
7677
if (!ex.IsCriticalException())
7778
{
78-
notifications.ShowError(ex.Message);
79+
//TODO:Will need a uniform solution to HTTP exception message handling
80+
var apiException = ex as ApiValidationException;
81+
var error = apiException?.ApiError?.Errors?.FirstOrDefault();
82+
notifications.ShowError(error?.Message ?? ex.Message);
7983
}
8084
});
8185
}

0 commit comments

Comments
 (0)