Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 0e1ba11

Browse files
author
jonas747
committed
fix panic on bad requests
1 parent c73bddd commit 0e1ba11

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

restapi.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ func (s *Session) RequestWithBucket(method, urlStr, contentType string, b []byte
9393
break
9494
}
9595

96+
if err != nil {
97+
s.log(LogError, "Request error, retrying: %v", err)
98+
}
99+
96100
if ratelimited {
97101
i = 0
98102
} else {
@@ -118,6 +122,9 @@ func (s *Session) doRequest(method, urlStr, contentType string, b []byte, bucket
118122
}
119123

120124
req, resp, err := s.innerDoRequest(method, urlStr, contentType, b, bucket)
125+
if err != nil {
126+
return nil, true, false, err
127+
}
121128

122129
defer func() {
123130
err2 := resp.Body.Close()

0 commit comments

Comments
 (0)