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 26, 2017
1 parent cc6fb51 commit 4c5bbc4
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 @@ -181,7 +181,10 @@ out the first result.
See also: https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationRequest
*/
func bruteforceBucketLocation(region *string, request *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error) {
session, _ := session.NewSession(&aws.Config{Region: region})
session, err := session.NewSession(&aws.Config{Region: region})
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 4c5bbc4

Please sign in to comment.