Skip to content

Commit

Permalink
Add missed error handling on session.NewSession
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Aug 28, 2017
1 parent f123138 commit 1ac08b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/pkg/vfs/s3context.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ func bruteforceBucketLocation(region *string, request *s3.GetBucketLocationInput
config := &aws.Config{Region: region}
config = config.WithCredentialsChainVerboseErrors(true)

session, _ := session.NewSession(config)
session, err := session.NewSession(config)
if err != nil {
return nil, fmt.Errorf("error creating aws session: %v", err)
}

regions, err := ec2.New(session).DescribeRegions(nil)
if err != nil {
Expand Down

0 comments on commit 1ac08b5

Please sign in to comment.