Skip to content

Commit e0e2627

Browse files
committed
Fixed #198 Improved Response Logging
1 parent 4d56c19 commit e0e2627

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Exceptionless/Submission/DefaultSubmissionClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ private string GetResponseMessage(HttpResponseMessage response) {
176176
return null;
177177

178178
int statusCode = (int)response.StatusCode;
179+
if (statusCode == 401)
180+
return "401 Unauthorized.";
179181
if (statusCode == 404)
180182
return "404 Page not found.";
181183

@@ -189,7 +191,7 @@ private string GetResponseMessage(HttpResponseMessage response) {
189191
} catch { }
190192
}
191193

192-
return message;
194+
return !String.IsNullOrEmpty(message) ? message : $"{statusCode} {response.ReasonPhrase}";
193195
}
194196

195197
private string GetResponseText(HttpResponseMessage response) {

0 commit comments

Comments
 (0)