improve error handling in bucketExists()
Added call of validate() in bucketExists(). Reason: if the request for checking whether a bucket exists contains invalid credentials (see unit test), then S3 does not return an XML response. Instead the HTTP response body is empty. This in turn caused the validate() function to throw an XML parsing exception which in turn shadowed the original error. This behavior is different compared to when we list buckets. In this case, the response contains an HTTP body with a detailed error message encoded as XML.
Please register or sign in to comment