fix: classify proxied response stream failures

This commit is contained in:
NotoriousRebel
2026-08-26 16:33:58 -04:00
parent 227d189d7e
commit fabaea3886
2 changed files with 19 additions and 2 deletions
+18 -2
View File
@@ -3638,9 +3638,25 @@ async def test_shodan_action_records_configured_proxy_transport_failure(monkeypa
async def get_urls(self) -> set[str]:
return set()
class FailingContent:
async def iter_any(self):
raise OSError('proxy disconnected while streaming')
yield b''
class FailingResponse:
status = 200
headers: dict[str, str] = {}
content = FailingContent()
async def __aenter__(self):
return self
async def __aexit__(self, *_args: object) -> None:
return None
class FailingSession:
def request(self, *_args: object, **_kwargs: object) -> object:
raise OSError('proxy endpoint unavailable')
def request(self, *_args: object, **_kwargs: object) -> FailingResponse:
return FailingResponse()
class FailedShodan:
error_type = None
+1
View File
@@ -106,6 +106,7 @@ async def _bounded_response_chunks(
except ResponseStreamError:
raise
except (aiohttp.ClientError, TimeoutError, OSError) as error:
_mark_proxy_transport_failed()
raise ResponseStreamError('transport-error') from error