Bug 927881 - Check for errors before looking at the response object

https://bugzilla.mozilla.org/show_bug.cgi?id=927881