Skip to content

Commit

Permalink
Merge pull request #5680 from terraform-providers/b/lb-crash
Browse files Browse the repository at this point in the history
r/loadbalancer: fixing a crash during a dropped response
  • Loading branch information
tombuildsstuff authored Feb 11, 2020
2 parents aa34124 + e1ea220 commit b1f4070
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions azurerm/internal/services/network/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package network

import (
"fmt"
"net/http"
"regexp"
"strings"

Expand All @@ -11,6 +10,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

// TODO: refactor this
Expand Down Expand Up @@ -38,7 +38,7 @@ func retrieveLoadBalancerById(d *schema.ResourceData, loadBalancerId string, met

resp, err := client.Get(ctx, resGroup, name, "")
if err != nil {
if resp.StatusCode == http.StatusNotFound {
if utils.ResponseWasNotFound(resp.Response) {
return nil, false, nil
}
return nil, false, fmt.Errorf("Error making Read request on Azure Load Balancer %s: %s", name, err)
Expand Down

0 comments on commit b1f4070

Please sign in to comment.