Skip to content

Commit

Permalink
Merge pull request #3590 from Dominik-K/bugfix/r/iam_account_alias/er…
Browse files Browse the repository at this point in the history
…ror-message

iam_account_alias: Pass awserr in returned error
  • Loading branch information
bflad authored Mar 6, 2018
2 parents 55c2ba4 + b6b999f commit 70c5aeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws/resource_aws_iam_account_alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func resourceAwsIamAccountAliasCreate(d *schema.ResourceData, meta interface{})
_, err := conn.CreateAccountAlias(params)

if err != nil {
return fmt.Errorf("Error creating account alias with name %s", account_alias)
return fmt.Errorf("Error creating account alias with name '%s': %s", account_alias, err)
}

d.SetId(account_alias)
Expand All @@ -57,7 +57,7 @@ func resourceAwsIamAccountAliasRead(d *schema.ResourceData, meta interface{}) er
resp, err := conn.ListAccountAliases(params)

if err != nil {
return err
return fmt.Errorf("Error listing account aliases: %s", err)
}

if resp == nil || len(resp.AccountAliases) == 0 {
Expand Down Expand Up @@ -85,7 +85,7 @@ func resourceAwsIamAccountAliasDelete(d *schema.ResourceData, meta interface{})
_, err := conn.DeleteAccountAlias(params)

if err != nil {
return fmt.Errorf("Error deleting account alias with name %s", account_alias)
return fmt.Errorf("Error deleting account alias with name '%s': %s", account_alias, err)
}

d.SetId("")
Expand Down

0 comments on commit 70c5aeb

Please sign in to comment.