mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 19:11:30 +00:00
Update ApiErrorMessageSafe to return null for empty and whitespace strings (#1540)
* return null if ApiError.Message is empty or whitespace * Uncomment test, which now passes
This commit is contained in:
committed by
Ryan Gribble
parent
620b1b9d89
commit
01a2d97212
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user