Permalink
Browse files

Null-check of response ensures graceful handling of Airbrake downtime…

… and time-outs.
  • Loading branch information...
1 parent fbfec5e commit 9e7bd6496f7f938d6155396bed20b253ae072221 @asbjornu asbjornu committed May 23, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/app/SharpBrake/AirbrakeClient.cs
@@ -107,6 +107,12 @@ public void Send(AirbrakeNotice notice)
private void OnRequestEnd(WebRequest request, WebResponse response)
{
+ if (response == null)
+ {
+ this.log.Fatal(f => f("No response received!"));
+ return;
+ }
+
string responseBody;
using (var responseStream = response.GetResponseStream())

0 comments on commit 9e7bd64

Please sign in to comment.