Merge pull request #2546 from hashicorp/b-dme-not-found

providers/dme: unable to find record, set ID to "" [GH-2440]
This commit is contained in:
Mitchell Hashimoto 2015-06-29 10:34:43 -07:00
commit 9100ad57f6
1 changed files with 5 additions and 0 deletions

View File

@ -110,6 +110,11 @@ func resourceDMERecordRead(d *schema.ResourceData, meta interface{}) error {
rec, err := client.ReadRecord(domainid, recordid)
if err != nil {
if strings.Contains(err.Error(), "Unable to find") {
d.SetId("")
return nil
}
return fmt.Errorf("Couldn't find record: %s", err)
}