diff --git a/Octokit.Tests/Http/ConnectionTests.cs b/Octokit.Tests/Http/ConnectionTests.cs index e280bfa0..f6c0618e 100644 --- a/Octokit.Tests/Http/ConnectionTests.cs +++ b/Octokit.Tests/Http/ConnectionTests.cs @@ -349,7 +349,7 @@ namespace Octokit.Tests.Http Assert.Equal(45, exception.RetryAfterSeconds); } - [Fact(Skip = "Fails due to https://github.com/octokit/octokit.net/issues/1529. The message is empty but the default message isn't displayed. However, this isn't due to the introduction of AbuseException, but rather something else.")] + [Fact] public async Task ThrowsAbuseExceptionWithDefaultMessageForUnsafeAbuseResponse() { string messageText = string.Empty; diff --git a/Octokit/Exceptions/ApiException.cs b/Octokit/Exceptions/ApiException.cs index d68d8591..67b16735 100644 --- a/Octokit/Exceptions/ApiException.cs +++ b/Octokit/Exceptions/ApiException.cs @@ -178,7 +178,12 @@ namespace Octokit { get { - return ApiError != null ? ApiError.Message : null; + if (ApiError != null && !string.IsNullOrWhiteSpace(ApiError.Message)) + { + return ApiError.Message; + } + + return null; } }