File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ package gosnowflake
5
5
import (
6
6
"bytes"
7
7
"context"
8
+ "errors"
8
9
"fmt"
9
10
"io"
10
11
"math"
@@ -390,6 +391,13 @@ func (r *retryHTTP) execute() (res *http.Response, err error) {
390
391
}
391
392
392
393
func isRetryableError (req * http.Request , res * http.Response , err error ) (bool , error ) {
394
+ if errors .Is (err , context .DeadlineExceeded ) {
395
+ // Don't retry and return an unwrapped DeadlineExceeded error
396
+ return false , context .DeadlineExceeded
397
+ } else if errors .Is (err , context .Canceled ) {
398
+ // Don't retry and return an unwrapped Canceled error
399
+ return false , context .Canceled
400
+ }
393
401
if err != nil && res == nil { // Failed http connection. Most probably client timeout.
394
402
return true , err
395
403
}
You can’t perform that action at this time.
0 commit comments