d.SetId before return, may be up too late.

pass `go tool vet` (great resource by the way)
This commit is contained in:
Ernest W. Durbin III 2016-08-07 23:19:57 -04:00
parent 4f07b92447
commit 7036d9e1c4
2 changed files with 2 additions and 2 deletions

View File

@ -77,8 +77,8 @@ func resourceAwsLoadBalancerBackendServerPoliciesRead(d *schema.ResourceData, me
if err != nil {
if ec2err, ok := err.(awserr.Error); ok {
if ec2err.Code() == "LoadBalancerNotFound" {
return fmt.Errorf("LoadBalancerNotFound: %s", err)
d.SetId("")
return fmt.Errorf("LoadBalancerNotFound: %s", err)
}
}
return fmt.Errorf("Error retrieving ELB description: %s", err)

View File

@ -77,8 +77,8 @@ func resourceAwsLoadBalancerListenerPoliciesRead(d *schema.ResourceData, meta in
if err != nil {
if ec2err, ok := err.(awserr.Error); ok {
if ec2err.Code() == "LoadBalancerNotFound" {
return fmt.Errorf("LoadBalancerNotFound: %s", err)
d.SetId("")
return fmt.Errorf("LoadBalancerNotFound: %s", err)
}
}
return fmt.Errorf("Error retrieving ELB description: %s", err)