function get_bucket_region($bucket)
{
try {
$region = $this->get_s3client()->getBucketLocation(array('Bucket' => $bucket));
} catch (Exception $e) {
$error_msg_title = '<strong>' . __('Error Getting Bucket Region', 'amazon-s3-and-cloudfront') . '</strong> —';
$error_msg = sprintf(__('There was an error attempting to get the region of the bucket %s: %s', 'amazon-s3-and-cloudfront'), $bucket, $e->getMessage());
AS3CF_Error::log($error_msg);
return new WP_Error('exception', $error_msg_title . $error_msg);
}
$region = $this->translate_region($region['Location']);
return $region;
}