Skip to content

Commit 07838b2

Browse files
authored
more http resp msg in ex (#1326)
1 parent afaf774 commit 07838b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/KubernetesClient/Kubernetes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ protected virtual async Task<HttpResponseMessage> SendRequestRaw(string requestC
163163
if (!httpResponse.IsSuccessStatusCode)
164164
{
165165
string responseContent = null;
166-
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
167166
if (httpResponse.Content != null)
168167
{
169168
responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
@@ -173,6 +172,7 @@ protected virtual async Task<HttpResponseMessage> SendRequestRaw(string requestC
173172
responseContent = string.Empty;
174173
}
175174

175+
var ex = new HttpOperationException($"Operation returned an invalid status code '{statusCode}', response body {responseContent}");
176176
ex.Request = new HttpRequestMessageWrapper(httpRequest, requestContent);
177177
ex.Response = new HttpResponseMessageWrapper(httpResponse, responseContent);
178178
httpRequest.Dispose();

0 commit comments

Comments
 (0)