Skip to content

Commit

Permalink
feat: add debug log for invalid response
Browse files Browse the repository at this point in the history
ref #28
  • Loading branch information
HanaokaYuzu committed Jul 30, 2024
1 parent eb92274 commit 871faa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gemini_webapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,9 @@ async def generate_content(
raise Exception
except Exception:
await self.close()
logger.debug(f"Invalid response: {response.text}")
raise APIError(
f"Failed to generate contents. Invalid response data received: {response.text}. Client will try to re-initialize on next request."
"Failed to generate contents. Invalid response data received. Client will try to re-initialize on next request."
)

try:
Expand Down

0 comments on commit 871faa1

Please sign in to comment.