Skip to content

Commit 33bfd58

Browse files
cmbernard333evansimscoderabbitai[bot]
authored
Fix issue where aiohttp.ClientResponse data wasn't being awaited on (#197)
* Fix issue where aiohttp.ClientResponse data wasn't being awaited on during HTTP exception handling * Update openfga_sdk/rest.py Code review Co-authored-by: Evan Sims <[email protected]> * Update openfga_sdk/rest.py Make the bot happy Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Evan Sims <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent ea861f1 commit 33bfd58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

openfga_sdk/rest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ async def handle_response_exception(
278278
if 200 <= response.status <= 299:
279279
return
280280

281+
if isinstance(response, aiohttp.ClientResponse) and not hasattr(response, "data"):
282+
response.data = await response.read()
281283
match response.status:
282284
case 400:
283285
raise ValidationException(http_resp=response)

0 commit comments

Comments
 (0)