From 9d69bc0b483c7d4df30af82717bc95e255abfcf0 Mon Sep 17 00:00:00 2001
From: Nick Craig-Wood <nick@craig-wood.com>
Date: Tue, 29 Oct 2019 16:25:13 +0000
Subject: [PATCH] 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.
---
 fs/fshttp/http.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fshttp/http.go b/fs/fshttp/http.go
index cb4e219ac..db1face8b 100644
--- a/fs/fshttp/http.go
+++ b/fs/fshttp/http.go
@@ -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)
 		}
 	}