Commit 006042d
Copybara import of the project:
--
2040191 by Danilo Bardusco <danilo@bardusco.com>:
fix: handle non-list response_stream in HttpResponse.json property
When using the aiohttp backend and Google API returns a 500 error,
the response_stream can be an aiohttp.ClientResponse object instead
of a list. This causes 'TypeError: ClientResponse object is not
subscriptable' when trying to access response_stream[0].
This fix adds a type check before attempting list access, returning
None for non-list response_stream values to allow proper error
handling to continue.
Fixes: #1897
COPYBARA_INTEGRATE_REVIEW=#1903 from taubot-ai:fix-aiohttp-clientresponse-subscript-error f164187
PiperOrigin-RevId: 8747849581 parent ecfa90c commit 006042d
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
271 | 277 | | |
272 | 278 | | |
273 | 279 | | |
| |||
0 commit comments