Skip to content

Commit

Permalink
clean up error return in path_login to correctly check for throttling…
Browse files Browse the repository at this point in the history
… error
  • Loading branch information
catsby committed Sep 6, 2018
1 parent c5f6049 commit b01aaad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin/credential/aws/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/fullsailor/pkcs7"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/go-cleanhttp"
multierror "github.com/hashicorp/go-multierror"
"github.com/hashicorp/go-uuid"
"github.com/hashicorp/vault/helper/awsutil"
"github.com/hashicorp/vault/helper/jsonutil"
Expand Down Expand Up @@ -170,7 +171,7 @@ func (b *backend) validateInstance(ctx context.Context, s logical.Storage, insta
})
if err != nil {
errW := errwrap.Wrapf(fmt.Sprintf("error fetching description for instance ID %q: {{err}}", instanceID), err)
return nil, awsutil.AppendLogicalError(errW)
return nil, multierror.Append(errW, awsutil.CheckAWSError(err))
}
if status == nil {
return nil, fmt.Errorf("nil output from describe instances")
Expand Down

0 comments on commit b01aaad

Please sign in to comment.