Struct: retry.RetryableConnectionError
import "../ibm-cos-sdk-go-v2/aws/retry"
Overview
IsErrorRetryable returns if the error is caused by and HTTP connection error, and should be retried.
Implemented Interfaces
types.AnalyticsFilter, v4.HTTPPresigner, s3.HTTPPresignerV4, retry.IsErrorRetryable, types.MetricsFilter, s3.PresignPost, arn.S3ObjectLambdaARN, types.SelectObjectContentEventStream
Method Details
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
// File 'aws/retry/retryable_error.go', line 87
func (r RetryableConnectionError) IsErrorRetryable(err error) aws.Ternary {
if err == nil {
return aws.UnknownTernary
}
var retryable bool
var conErr interface{ ConnectionError() bool }
var tempErr interface{ Temporary() bool }
var timeoutErr interface{ Timeout() bool }
var urlErr *url.Error
var netOpErr *net.OpError
var dnsError *net.DNSError
if errors.As(err, &dnsError) {
if dnsError.IsNotFound {
return aws.BoolTernary(false)
}
if dnsError.Temporary() {
return aws.BoolTernary(true)
}
}
switch {
case errors.As(err, &conErr) && conErr.ConnectionError():
retryable = true
case strings.Contains(err.Error(), "use of closed network connection"):
fallthrough
case strings.Contains(err.Error(), "connection reset"):
retryable = true
case errors.As(err, &urlErr):
if strings.Contains(urlErr.Error(), "connection refused") {
retryable = true
} else {
return r.IsErrorRetryable(errors.Unwrap(urlErr))
}
case errors.As(err, &netOpErr):
if strings.EqualFold(netOpErr.Op, "dial") || netOpErr.Temporary() {
retryable = true
} else {
return r.IsErrorRetryable(errors.Unwrap(netOpErr))
}
case errors.As(err, &tempErr) && tempErr.Temporary():
retryable = true
case errors.As(err, &timeoutErr) && timeoutErr.Timeout():
retryable = true
default:
return aws.UnknownTernary
}
return aws.BoolTernary(retryable)
}
|