use the same error checking in DELETE

This commit is contained in:
clint shryock 2016-01-29 12:38:22 -06:00
parent 3bbb21d115
commit 39f5a7e751

View File

@ -345,9 +345,14 @@ func resourceAwsRoute53RecordDelete(d *schema.ResourceData, meta interface{}) er
// Get the records
rec, err := findRecord(d, meta)
if err != nil {
log.Printf("[DEBUG] No matching record found for: %s, removing from state file", d.Id())
d.SetId("")
return err
switch err {
case r53NoHostedZoneFound, r53NoRecordsFound:
log.Printf("[DEBUG] %s for: %s, removing from state file", err, d.Id())
d.SetId("")
return nil
default:
return err
}
}
// Create the new records