aboutsummaryrefslogtreecommitdiffstats
path: root/drive/errors.go
diff options
context:
space:
mode:
Diffstat (limited to 'drive/errors.go')
-rw-r--r--drive/errors.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/drive/errors.go b/drive/errors.go
index e7631f7..465d818 100644
--- a/drive/errors.go
+++ b/drive/errors.go
@@ -1,6 +1,7 @@
package drive
import (
+ "golang.org/x/net/context"
"google.golang.org/api/googleapi"
"time"
)
@@ -16,6 +17,10 @@ func isBackendError(err error) bool {
return ok && ae.Code >= 500 && ae.Code <= 599
}
+func isTimeoutError(err error) bool {
+ return err == context.Canceled
+}
+
func exponentialBackoffSleep(try int) {
seconds := pow(2, try)
time.Sleep(time.Duration(seconds) * time.Second)