MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / _is_proxy_connection_error

Method _is_proxy_connection_error

src/services/flow_client.py:874–885  ·  view source on GitHub ↗

识别本地/上游代理不可用导致的连接失败。

(self, error: Exception)

Source from the content-addressed store, hash-verified

872 ])
873
874 def _is_proxy_connection_error(self, error: Exception) -> bool:
875 """识别本地/上游代理不可用导致的连接失败。"""
876 error_lower = str(error).lower()
877 return any(keyword in error_lower for keyword in [
878 "failed to connect to 127.0.0.1 port",
879 "failed to connect to localhost port",
880 "proxyerror",
881 "proxy error",
882 "failed to connect to proxy",
883 "couldn't connect to server",
884 "curl: (7)",
885 ])
886
887 def _is_retryable_network_error(self, error_str: str) -> bool:
888 """识别可重试的 TLS/连接类网络错误。"""

Callers 1

st_to_atMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected