From 20ba476c9728b87d5c61a6a6884b992554c3b1bf Mon Sep 17 00:00:00 2001 From: John Lambert Date: Mon, 16 Sep 2024 12:45:48 -0400 Subject: [PATCH] Log the headers --- .../Serval.Machine.Shared/Services/ClearMLService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Machine/src/Serval.Machine.Shared/Services/ClearMLService.cs b/src/Machine/src/Serval.Machine.Shared/Services/ClearMLService.cs index d486e0fb..33ddcb5b 100644 --- a/src/Machine/src/Serval.Machine.Shared/Services/ClearMLService.cs +++ b/src/Machine/src/Serval.Machine.Shared/Services/ClearMLService.cs @@ -216,11 +216,19 @@ private async Task> GetTasksAsync( } catch { + StringBuilder headerString = new(); + foreach (KeyValuePair> header in response.Headers) + { + headerString.Append( + CultureInfo.InvariantCulture, + $"{header.Key}: {string.Join(", ", header.Value)}{Environment.NewLine}" + ); + } _logger.LogWarning( "Failed to parse ClearML response with code {httpCode} from request path `{request}`: {Response}", response.StatusCode, requestPath, - result + headerString.ToString() ); throw; }