Skip to content

Commit

Permalink
Rename variables for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
evilpilaf committed Feb 27, 2020
1 parent 01f9f1c commit 4d60a7f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Honeycomb.Serilog.Sink/HoneycombSerilogSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ private async Task SendBatchedEvents(string events)
};

requestMessage.Headers.Add("X-Honeycomb-Team", _apiKey);
var result = await SendRequest(requestMessage).ConfigureAwait(false);
if (!result.IsSuccessStatusCode)
var response = await SendRequest(requestMessage).ConfigureAwait(false);
if (!response.IsSuccessStatusCode)
{
using (Stream contentStream = await result.Content.ReadAsStreamAsync().ConfigureAwait(false))
using (Stream contentStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
using (var reader = new StreamReader(contentStream))
{
var response = await reader.ReadToEndAsync().ConfigureAwait(false);
SelfLog.WriteLine("Failure sending event to Honeycomb, received {statusCode} response with content {content}", result.StatusCode, response);
var responseContent = await reader.ReadToEndAsync().ConfigureAwait(false);
SelfLog.WriteLine("Failure sending event to Honeycomb, received {statusCode} response with content {content}", response.StatusCode, responseContent);
}
}
}
Expand Down

0 comments on commit 4d60a7f

Please sign in to comment.