Skip to content

Commit

Permalink
added handling 404 when deleting hvn route
Browse files Browse the repository at this point in the history
  • Loading branch information
smaant committed Jun 4, 2021
1 parent 6073695 commit c42cc01
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/provider/resource_hvn_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ func resourceHvnRouteDelete(ctx context.Context, d *schema.ResourceData, meta in
log.Printf("[INFO] Deleting HVN route (%s)", routeID)
resp, err := clients.DeleteHVNRouteByID(ctx, client, hvnLink.ID, routeID, loc)
if err != nil {
if clients.IsResponseCodeNotFound(err) {
log.Printf("[WARN] HVN route (%s) not found, so no action was taken", routeID)
return nil
}

return diag.Errorf("unable to delete HVN route (%s): %v", routeID, err)
}

Expand Down

0 comments on commit c42cc01

Please sign in to comment.