Skip to content

Commit

Permalink
r/lb_listener: Standardize errors
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Apr 5, 2021
1 parent 51b410e commit 15f2a14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aws/resource_aws_lb_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func resourceAwsLbListenerCreate(d *schema.ResourceData, meta interface{}) error
}

if err != nil {
return fmt.Errorf("error creating ELBv2 Listener: %s", err)
return fmt.Errorf("error creating ELBv2 Listener (%s): %w", d.Get("load_balancer_arn").(string), err)
}

if output == nil || len(output.Listeners) == 0 {
Expand Down Expand Up @@ -751,7 +751,7 @@ func resourceAwsLbListenerRead(d *schema.ResourceData, meta interface{}) error {
defaultActions[i] = defaultActionMap
}
if err := d.Set("default_action", defaultActions); err != nil {
return fmt.Errorf("error setting default_action: %s", err)
return fmt.Errorf("error setting default_action for ELBv2 listener (%s): %w", d.Id(), err)
}

return nil
Expand Down Expand Up @@ -935,7 +935,7 @@ func resourceAwsLbListenerUpdate(d *schema.ResourceData, meta interface{}) error
}

if err != nil {
return fmt.Errorf("Error modifying LB Listener: %s", err)
return fmt.Errorf("error modifying ELBv2 Listener (%s): %w", d.Id(), err)
}

return resourceAwsLbListenerRead(d, meta)
Expand All @@ -948,7 +948,7 @@ func resourceAwsLbListenerDelete(d *schema.ResourceData, meta interface{}) error
ListenerArn: aws.String(d.Id()),
})
if err != nil {
return fmt.Errorf("Error deleting Listener: %s", err)
return fmt.Errorf("error deleting Listener (%s): %w", d.Id(), err)
}

return nil
Expand Down

0 comments on commit 15f2a14

Please sign in to comment.