From 7bb2a26b5eed3aa8dccefc7a09acbd9f645c7039 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 28 Jun 2015 23:31:44 -0700 Subject: [PATCH] providers/dme: unable to find record, set ID to "" [GH-2440] --- builtin/providers/dme/resource_dme_record.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/providers/dme/resource_dme_record.go b/builtin/providers/dme/resource_dme_record.go index 6c50523bfe..8e078e4204 100644 --- a/builtin/providers/dme/resource_dme_record.go +++ b/builtin/providers/dme/resource_dme_record.go @@ -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) }