Fixing the DigitalOcean Droplet 404 potential on refresh of state

This commit is contained in:
stack72 2015-11-05 15:01:07 +00:00
parent 2d025a0d36
commit 9ff45325b2
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ func resourceDigitalOceanDropletRead(d *schema.ResourceData, meta interface{}) e
droplet, _, err := client.Droplets.Get(id)
if err != nil {
// check if the droplet no longer exists.
if err.Error() == "Error retrieving droplet: API Error: 404 Not Found" {
if strings.Contains(err.Error(), "404 The resource you were accessing could not be found") {
d.SetId("")
return nil
}