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

Method _is_timeout_error

src/services/flow_client.py:863–872  ·  view source on GitHub ↗

判断是否为网络超时,便于快速失败重试。

(self, error: Exception)

Source from the content-addressed store, hash-verified

861 raise Exception(f"Invalid JSON response: {body_text[:200]}") from exc
862
863 def _is_timeout_error(self, error: Exception) -> bool:
864 """判断是否为网络超时,便于快速失败重试。"""
865 error_lower = str(error).lower()
866 return any(keyword in error_lower for keyword in [
867 "timed out",
868 "timeout",
869 "curl: (28)",
870 "connection timed out",
871 "operation timed out",
872 ])
873
874 def _is_proxy_connection_error(self, error: Exception) -> bool:
875 """识别本地/上游代理不可用导致的连接失败。"""

Callers 3

create_projectMethod · 0.95
upload_imageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected