Skip to content

Commit

Permalink
Add error handling on creating a new S3 client
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Sep 21, 2023
1 parent 24b1245 commit 6199d6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agent/taskresource/credentialspec/credentialspec_linux.go
Expand Up @@ -436,6 +436,11 @@ func (cs *CredentialSpecResource) handleS3CredentialspecFile(originalCredentialS
}

s3Client, err := cs.s3ClientCreator.NewS3Client(bucket, cs.region, iamCredentials)
if err != nil {
cs.setTerminalReason(err.Error())
errorEvents <- err
return
}

credSpecJsonStringUnformatted, err := s3.GetObject(bucket, key, s3Client)

Expand Down

0 comments on commit 6199d6c

Please sign in to comment.