Fix bug in error handler when response is None

Regression introduced in #298.
Merge branch 's3-error-fix' into develop

* s3-error-fix:
  Fix bug in error handler when response is None