Skip to content

Commit

Permalink
log elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
hellopatrick committed Oct 7, 2022
1 parent c288c50 commit 3b96bac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/roundtripper/roundtripper.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func NewAWSSigningTransport(transport http.RoundTripper, region string, log log.
}

func (a *AWSSigningTransport) RoundTrip(req *http.Request) (*http.Response, error) {
a.refreshCredentialsIfNeeded()
if err := a.refreshCredentialsIfNeeded(); err != nil {
_ = level.Error(a.log).Log("msg", "fail to refresh aws credentials", "err", err)
}

signer := v4.NewSigner()
payloadHash, newReader, err := hashPayload(req.Body)
Expand All @@ -87,7 +89,6 @@ func (a *AWSSigningTransport) refreshCredentialsIfNeeded() error {
creds, err := a.cfg.Credentials.Retrieve(context.Background())

if err != nil {
_ = level.Error(a.log).Log("msg", "fail to refresh aws credentials", "err", err)
return err
}

Expand Down

0 comments on commit 3b96bac

Please sign in to comment.