Fix error handling when request-level errors occur.

Replaces #15, fixes issue introduced in #12.

If a request-level error happens (say, your internet connection is not available), we’re checking `response.statusCode` first (which doesn’t exist). 

Thanks to @brettkiefer for the fix, this PR just adds a test to his fix.