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

Commit

Permalink
Update src/Middleware/RetryHandler.cs
Browse files Browse the repository at this point in the history
Co-authored-by: Eastman <[email protected]>
  • Loading branch information
DCourtel and andrueastman authored Mar 25, 2024
1 parent 906a4fd commit 34f91da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Middleware/RetryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ private static async Task<Exception> GetInnerExceptionAsync(HttpResponseMessage
errorMessage = GetStringFromContent(responseContent);
}

return new Exception($"HTTP request failed with status code: {httpStatusCode}.{errorMessage}");
return new ApiException($"HTTP request failed with status code: {httpStatusCode}.{errorMessage}")
{
ResponseStatusCode = (int)response.StatusCode,
ResponseHeaders = response.Headers.ToDictionary()
};
}

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

0 comments on commit 34f91da

Please sign in to comment.