Skip to content

The agent that grows with you

fix(gateway): anchor errno/winerror connection markers with word boundaries

Halldrix6d2765b75504
diff --git a/gateway/run.py b/gateway/run.py
index af8fe081153..2d19ba5645c 100644
--- a/gateway/run.py
+++ b/gateway/run.py
@@ -390,7 +390,7 @@ _GATEWAY_RATE_LIMIT_RE = re.compile(
_CONNECTION_ERROR_MARKERS = (
r"(?:\w+\.)?(?:api\s*)?connection\s*(?:error|timeout)", r"(?:\w+\.)?connect\s*(?:error|timeout)",
r"connection\s+refused", r"connection\s+reset", r"connection\s+aborted", r"actively\s+refused",
- r"winerror\s+10061", r"errno\s+111", r"no\s+route\s+to\s+host", r"network\s+is\s+unreachable",
+ r"winerror\s+10061\b", r"errno\s+111\b", r"no\s+route\s+to\s+host", r"network\s+is\s+unreachable",
r"cannot\s+connect", r"failed\s+to\s+establish", r"could\s+not\s+connect")
_GATEWAY_CONNECTION_ERROR_RE = re.compile("(" + "|".join(_CONNECTION_ERROR_MARKERS) + ")", re.IGNORECASE)