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 bf11be82c8
commit 032a42797e
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
}