providers/dme: unable to find record, set ID to "" [GH-2440]
This commit is contained in:
parent
da1cac623d
commit
7bb2a26b5e
|
@ -110,6 +110,11 @@ func resourceDMERecordRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
rec, err := client.ReadRecord(domainid, recordid)
|
rec, err := client.ReadRecord(domainid, recordid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if strings.Contains(err.Error(), "Unable to find") {
|
||||||
|
d.SetId("")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return fmt.Errorf("Couldn't find record: %s", err)
|
return fmt.Errorf("Couldn't find record: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue