Skip to content

Commit

Permalink
correct error message format
Browse files Browse the repository at this point in the history
  • Loading branch information
jasdel committed Feb 20, 2017
1 parent dabb11d commit e136293
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aws/credentials/stscreds/assume_role_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/service/sts"
Expand Down Expand Up @@ -183,7 +184,8 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
input.TokenCode = aws.String(code)
} else {
return credentials.Value{ProviderName: ProviderName},
fmt.Errorf("assume role with MFA enabled, but neither TokenCode nor TokenProvider are set.")
awserr.New("AssumeRoleTokenNotAvailable",
"assume role with MFA enabled, but neither TokenCode nor TokenProvider are set", nil)
}
}

Expand Down

0 comments on commit e136293

Please sign in to comment.