GlobalRouter.stream() and stream_async() send requests with stream=True, then pass a >=400 response directly to error_from_response() without reading the body first. For a real streaming response, response.json()/response.text access raises httpx.ResponseNotRead, so callers do not receive the documented GlobalRouterError. Reproduce with a mock SyncByteStream returning a 400 JSON error body and calling client.stream(...); it raises ResponseNotRead. Read/aread the response before normalizing the error.
File: src/globalrouter/_client.py
Line: 214
Severity: medium
Summary: unread streaming response in globalrouter.stream
GlobalRouter.stream()andstream_async()send requests withstream=True, then pass a >=400 response directly toerror_from_response()without reading the body first. For a real streaming response,response.json()/response.textaccess raiseshttpx.ResponseNotRead, so callers do not receive the documentedGlobalRouterError. Reproduce with a mockSyncByteStreamreturning a 400 JSON error body and callingclient.stream(...); it raisesResponseNotRead. Read/aread the response before normalizing the error.File:
src/globalrouter/_client.pyLine: 214
Severity: medium
Summary: unread streaming response in globalrouter.stream