From 66235041cc3ceee223a6ca6bb6dfbda345954059 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Fri, 16 Feb 2024 14:06:10 +0100 Subject: [PATCH] add response body to exception message --- .../commercetools.Base.Client/ExceptionFactory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commercetools.Sdk/commercetools.Base.Client/ExceptionFactory.cs b/commercetools.Sdk/commercetools.Base.Client/ExceptionFactory.cs index 8f224e9c97f..b2f23c95d09 100644 --- a/commercetools.Sdk/commercetools.Base.Client/ExceptionFactory.cs +++ b/commercetools.Sdk/commercetools.Base.Client/ExceptionFactory.cs @@ -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> t = new List>(); var headers = new ApiHttpHeaders(response.Headers.SelectMany(pair => pair.Value.Select(v => new KeyValuePair(pair.Key, v))).ToList()); switch (statusCode) @@ -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(pair.Key, v))).ToList()); switch (statusCode) {