Add check errors on reading CORS rules

This commit is contained in:
Kazunori Kojima 2015-10-28 09:19:37 +09:00
parent e0632de30c
commit 122790d32b
1 changed files with 3 additions and 1 deletions

View File

@ -276,7 +276,9 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error {
rule["max_age_seconds"] = ruleObject.MaxAgeSeconds
rules = append(rules, rule)
}
d.Set("cors_rule", rules)
if err := d.Set("cors_rule", rules); err != nil {
return fmt.Errorf("error reading S3 bucket \"%s\" CORS rules: %s", d.Id(), err)
}
}
// Read the website configuration