From b01aaad7da6ac4a52c8160f09bd542a64224426c Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Thu, 6 Sep 2018 10:31:46 -0500 Subject: [PATCH] clean up error return in path_login to correctly check for throttling error --- builtin/credential/aws/path_login.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/credential/aws/path_login.go b/builtin/credential/aws/path_login.go index 0a4cec6569c4..91b539d0d8e5 100644 --- a/builtin/credential/aws/path_login.go +++ b/builtin/credential/aws/path_login.go @@ -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" @@ -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")