Skip to content

Commit

Permalink
Merge pull request #2546 from hashicorp/b-dme-not-found
Browse files Browse the repository at this point in the history
providers/dme: unable to find record, set ID to "" [GH-2440]
  • Loading branch information
mitchellh committed Jun 29, 2015
2 parents 12e429c + 7bb2a26 commit 9100ad5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/providers/dme/resource_dme_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 9100ad5

Please sign in to comment.