MCPcopy Index your code
hub / github.com/docker/docker-agent / isProxySocketError

Function isProxySocketError

pkg/remote/transport.go:143–166  ·  view source on GitHub ↗

isProxySocketError checks if the error indicates the proxy socket is unavailable. This includes: - "no such file or directory" - socket file was deleted - "connection refused" - socket exists but nothing is listening - "dial unix" errors - general Unix socket connection failures

(err error)

Source from the content-addressed store, hash-verified

141// - "connection refused" - socket exists but nothing is listening
142// - "dial unix" errors - general Unix socket connection failures
143func isProxySocketError(err error) bool {
144 if err == nil {
145 return false
146 }
147
148 errStr := strings.ToLower(err.Error())
149
150 // Check for common proxy socket failure patterns
151 proxyErrorPatterns := []string{
152 "no such file or directory", // Socket file deleted
153 "connect: connection refused", // Socket exists but no listener
154 "proxyconnect tcp", // Proxy connection failure
155 "dial unix", // Unix socket dial failure
156 "unix socket", // Generic Unix socket error
157 }
158
159 for _, pattern := range proxyErrorPatterns {
160 if strings.Contains(errStr, pattern) {
161 return true
162 }
163 }
164
165 return false
166}

Callers 3

TestIsProxySocketErrorFunction · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85

Calls 1

ErrorMethod · 0.45

Tested by 2

TestIsProxySocketErrorFunction · 0.68
RoundTripMethod · 0.68