Skip to content

Commit

Permalink
Improve ESI request logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoeppner committed Mar 9, 2022
1 parent 4251067 commit 1e8bc73
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/EVEMon.Common/Net/HttpClientServiceRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,19 @@ private static void EnsureSuccessStatusCode(HttpResponseMessage response)
{
response.StatusCode = HttpStatusCode.OK;
response.ReasonPhrase = "OK";
} else if (code != HttpStatusCode.NotModified)
}
else if (code != HttpStatusCode.NotModified)
{
if (response.RequestMessage.RequestUri.ToString().StartsWith(NetworkConstants.ESIBase) && !response.IsSuccessStatusCode)
{
String body = response.Content.ReadAsStringAsync().Result;

EveMonClient.Trace($"Request: {response.RequestMessage.RequestUri} returned: {(Int32)response.StatusCode} ({response.ReasonPhrase}) with content: '{body}'.", printMethod: false);
}

// Allow "not modified" so that it will be detected by the front end
response.EnsureSuccessStatusCode();
}
}

/// <summary>
Expand Down

0 comments on commit 1e8bc73

Please sign in to comment.