Skip to content

Commit 4110266

Browse files
authored
Mark no such host error as downstream (#1089)
1 parent 22ef5f5 commit 4110266

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

experimental/errorsource/error_source_middleware.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package errorsource
22

33
import (
44
"errors"
5+
"net"
56
"net/http"
67
"syscall"
78

@@ -28,6 +29,10 @@ func RoundTripper(_ httpclient.Options, next http.RoundTripper) http.RoundTrippe
2829
if errors.Is(err, syscall.ECONNREFUSED) {
2930
return res, Error{source: backend.ErrorSourceDownstream, err: err}
3031
}
32+
var dnsError *net.DNSError
33+
if errors.As(err, &dnsError) && dnsError.IsNotFound {
34+
return res, Error{source: backend.ErrorSourceDownstream, err: err}
35+
}
3136
return res, err
3237
})
3338
}

0 commit comments

Comments
 (0)