Skip to content

Commit

Permalink
Log the headers (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 authored Sep 16, 2024
1 parent 2644f51 commit 8c5f802
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,19 @@ private async Task<IReadOnlyList<ClearMLTask>> GetTasksAsync(
}
catch
{
StringBuilder headerString = new();
foreach (KeyValuePair<string, IEnumerable<string>> 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;
}
Expand Down

0 comments on commit 8c5f802

Please sign in to comment.