diff --git a/storage/go110.go b/storage/go110.go index 75be3cbb5d5b..206813f0cea4 100644 --- a/storage/go110.go +++ b/storage/go110.go @@ -24,6 +24,8 @@ func shouldRetry(err error) bool { // Retry on 429 and 5xx, according to // https://cloud.google.com/storage/docs/exponential-backoff. return e.Code == 429 || (e.Code >= 500 && e.Code < 600) + case interface{ Temporary() bool }: + return e.Temporary() default: return false } diff --git a/storage/not_go110.go b/storage/not_go110.go index 700fde1ccb7c..66fa45bea2fe 100644 --- a/storage/not_go110.go +++ b/storage/not_go110.go @@ -34,6 +34,8 @@ func shouldRetry(err error) bool { // Unfortunately the error type is unexported, so we resort to string // matching. return strings.Contains(e.Error(), "REFUSED_STREAM") + case interface{ Temporary() bool }: + return e.Temporary() default: return false }