MCPcopy Create free account
hub / github.com/apify/crawlee-python / _is_proxy_error

Method _is_proxy_error

src/crawlee/http_clients/_impit.py:257–268  ·  view source on GitHub ↗

Determine whether the given error is related to a proxy issue. Check if the error message contains known proxy-related error keywords.

(error: HTTPError)

Source from the content-addressed store, hash-verified

255
256 @staticmethod
257 def _is_proxy_error(error: HTTPError) -> bool:
258 """Determine whether the given error is related to a proxy issue.
259
260 Check if the error message contains known proxy-related error keywords.
261 """
262 if isinstance(error, ImpitProxyError):
263 return True
264
265 if any(needle in str(error) for needle in ROTATE_PROXY_ERRORS): # noqa: SIM103
266 return True
267
268 return False
269
270 @override
271 async def cleanup(self) -> None:

Callers 2

crawlMethod · 0.95
send_requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected