fshttp: don't print token bucket errors on context cancelled

These happen as a natural part of exceeding --max-transfer and we
don't need to worry the user with them.
This commit is contained in:
Nick Craig-Wood 2019-10-29 16:25:13 +00:00
parent 7ff95c6250
commit e6378daadf
1 changed files with 1 additions and 1 deletions

View File

@ -318,7 +318,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
// Get transactions per second token first if limiting
if tpsBucket != nil {
tbErr := tpsBucket.Wait(req.Context())
if tbErr != nil {
if tbErr != nil && tbErr != context.Canceled {
fs.Errorf(nil, "HTTP token bucket error: %v", tbErr)
}
}