improve error handling for AWS s3.
Merge pull request #760 from crate/l/hotfix-s3

L/hotfix s3