Skip to content

Commit

Permalink
add response body to exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Feb 16, 2024
1 parent 7e9f686 commit 6623504
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private static ApiHttpException CreateServerException(HttpRequestMessage request
{
var statusCode = (int)response.StatusCode;
var body = response.ExtractResponseBody();
var message = $"Server error response {request.RequestUri} {statusCode} {response.ReasonPhrase}";
var message = $"Server error response {request.RequestUri} {statusCode} {response.ReasonPhrase} {body}";
List<KeyValuePair<string, string>> t = new List<KeyValuePair<string, string>>();
var headers = new ApiHttpHeaders(response.Headers.SelectMany(pair => pair.Value.Select(v => new KeyValuePair<string, string>(pair.Key, v))).ToList());
switch (statusCode)
Expand All @@ -60,7 +60,7 @@ private static ApiHttpException CreateClientException(HttpRequestMessage request
{
var statusCode = (int)response.StatusCode;
var body = response.ExtractResponseBody();
var message = $"Client error response {request.RequestUri} {statusCode} {response.ReasonPhrase}";
var message = $"Client error response {request.RequestUri} {statusCode} {response.ReasonPhrase} {body}";
var headers = new ApiHttpHeaders(response.Headers.SelectMany(pair => pair.Value.Select(v => new KeyValuePair<string, string>(pair.Key, v))).ToList());
switch (statusCode)
{
Expand Down

0 comments on commit 6623504

Please sign in to comment.