Determine whether the given error is related to a proxy issue. Check if the error is an instance of `httpx.ProxyError` or if its message contains known proxy-related error keywords.
(error: httpx.TransportError)
| 338 | |
| 339 | @staticmethod |
| 340 | def _is_proxy_error(error: httpx.TransportError) -> bool: |
| 341 | """Determine whether the given error is related to a proxy issue. |
| 342 | |
| 343 | Check if the error is an instance of `httpx.ProxyError` or if its message contains known proxy-related |
| 344 | error keywords. |
| 345 | """ |
| 346 | if isinstance(error, httpx.ProxyError): |
| 347 | return True |
| 348 | |
| 349 | if any(needle in str(error) for needle in ROTATE_PROXY_ERRORS): # noqa: SIM103 |
| 350 | return True |
| 351 | |
| 352 | return False |
| 353 | |
| 354 | async def cleanup(self) -> None: |
| 355 | for client in self._client_by_proxy_url.values(): |
no outgoing calls
no test coverage detected