Skip to content

Commit 64805ae

Browse files
feat: Publish restricted_route_unavailable and unknown proxy_error codes
Stainless-Generated-From: 30b8dbda88df8b8b5d482c48532d5826e1ce35a4
1 parent f6782d5 commit 64805ae

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

‎src/kernel/types/browsers/browser_proxy_error_event.py‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,23 @@ class Data(BrowserEventContext):
2222
"provider_unreachable",
2323
"provider_rejected",
2424
"origin_tls_timeout",
25+
"origin_response_incomplete",
2526
"proxy_unavailable",
27+
"restricted_route_unavailable",
2628
"upstream_timeout",
2729
"upstream_dns_failure",
2830
"upstream_connect_failed",
31+
"unknown",
2932
]
3033
"""
3134
Proxy-layer error code: the X-Kernel-Proxy-Error response header value from a
3235
branded 5xx error page served by the metro egress host-proxy. Values mirror what
3336
the proxy emits: destination_blocked, provider_blacklisted,
34-
provider_unreachable, provider_rejected, origin_tls_timeout, proxy_unavailable,
35-
upstream_timeout, upstream_dns_failure, upstream_connect_failed. Unknown header
36-
values are dropped.
37+
provider_unreachable, provider_rejected, origin_tls_timeout,
38+
origin_response_incomplete, proxy_unavailable, restricted_route_unavailable,
39+
upstream_timeout, upstream_dns_failure, upstream_connect_failed. A header value
40+
the browser image does not recognize is reported as unknown, with the header
41+
value in raw_code.
3742
"""
3843

3944
request_id: str
@@ -45,6 +50,14 @@ class Data(BrowserEventContext):
4550
method: Optional[str] = None
4651
"""HTTP method of the failed request, when known."""
4752

53+
raw_code: Optional[str] = None
54+
"""Sanitized X-Kernel-Proxy-Error header value, present only when code is unknown.
55+
56+
Surrounding whitespace is removed, the value is lowercased, characters outside
57+
[a-z0-9_] are replaced with \\__, and the result is truncated to at most 64
58+
characters.
59+
"""
60+
4861
resource_type: Optional[str] = None
4962
"""CDP Network.ResourceType for the request, when known."""
5063

0 commit comments

Comments
 (0)