Fixing the DigitalOcean Droplet 404 potential on refresh of state
This commit is contained in:
parent
bf11be82c8
commit
032a42797e
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue