Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Remove default error message text.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Courtel committed Mar 24, 2024
1 parent c764430 commit d815e33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Middleware/RetryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private static bool ShouldRetry(HttpStatusCode statusCode)
private static async Task<Exception> GetInnerException(HttpResponseMessage response, CancellationToken cancellationToken)
{
var httpStatusCode = response.StatusCode;
var errorMessage = "The response has not content.";
string? errorMessage = null;

// Drain response content to free connections. Need to perform this
// before retry attempt and before the TooManyRetries ServiceException.
Expand All @@ -248,7 +248,7 @@ private static async Task<Exception> GetInnerException(HttpResponseMessage respo
errorMessage = GetStringFromContent(responseContent);
}

return new Exception($"HTTP request failed with status code: {httpStatusCode}. Error Message: {errorMessage}");
return new Exception($"HTTP request failed with status code: {httpStatusCode}.{errorMessage}");
}

private static string GetStringFromContent(byte[] content)
Expand Down

0 comments on commit d815e33

Please sign in to comment.