minor enhancement on error handling in s3 adapter