def bucket_exists?(bucket_name)
      begin
        s3 = AWS::S3.new
        s3.buckets[bucket_name].exists?

      rescue AWS::S3::Errors::SignatureDoesNotMatch => e
        raise AWSCredentialsInvalidError, 'AWS access credentials are invalid'
      rescue AWS::Errors::Base => s3e
        raise S3AccessError.new(s3e.http_response), s3e.message
      end
    end
def bucket_exists?(bucket_name)
      begin
        s3 = AWS::S3.new
        s3.buckets[bucket_name].exists?

      rescue AWS::S3::Errors::SignatureDoesNotMatch => e
        raise AWSCredentialsInvalidError, 'AWS access credentials are invalid'
      rescue AWS::Errors::Base => s3e
        raise S3AccessError.new(s3e.http_response), s3e.message
      end
    end
Checks if a S3 bucket name is in use.