providers/dme: unable to find record, set ID to "" [GH-2440]

This commit is contained in:
Mitchell Hashimoto 2015-06-28 23:31:44 -07:00
parent da1cac623d
commit 7bb2a26b5e
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)
}