识别本地/上游代理不可用导致的连接失败。
(self, error: Exception)
| 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/连接类网络错误。""" |