aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/qna/qna.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/qna/qna.go b/internal/qna/qna.go
index 3ad942c..1a016b0 100644
--- a/internal/qna/qna.go
+++ b/internal/qna/qna.go
@@ -142,7 +142,7 @@ func isConnError(err error) bool {
if !ok {
return false
}
- if urlErr.Err.Error() == "EOF" {
+ if str := urlErr.Err.Error(); str == "EOF" || str == "unexpected EOF" {
return true
}
opErr, ok := urlErr.Err.(*net.OpError)
@@ -161,10 +161,10 @@ func isTLSError(err error) bool {
if !ok {
return false
}
- if urlErr.Error() == "http: server gave HTTP response to HTTPS client" {
+ if urlErr.Err.Error() == "http: server gave HTTP response to HTTPS client" {
return true
}
- return strings.Contains(urlErr.Error(), "tls: ")
+ return strings.Contains(urlErr.Err.Error(), "tls: ")
}
func isTLSCertError(err error) bool {
@@ -183,7 +183,11 @@ func is3xxErr(err error) bool {
func isDeadlineError(err error) bool {
urlErr, ok := err.(*url.Error)
- return ok && errors.Is(urlErr.Err, context.DeadlineExceeded)
+ if ok && errors.Is(urlErr.Err, context.DeadlineExceeded) {
+ return true
+ }
+ opErr, ok := urlErr.Err.(*net.OpError)
+ return ok && opErr.Err.Error() == "i/o timeout"
}
func TrimWildcard(san string) string {