Skip to content

Commit 7362aea

Browse files
committed
Refactor: simplify ModelHTTPError handling
- Align with other model implementations (openai, groq) by removing unnecessary error transformation logic Resolves: #3088
1 parent 6806a6e commit 7362aea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pydantic_ai_slim/pydantic_ai/models/google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ async def _generate_content(
396396
func = self.client.aio.models.generate_content_stream if stream else self.client.aio.models.generate_content
397397
try:
398398
return await func(model=self._model_name, contents=contents, config=config) # type: ignore
399-
except errors.APIError as e: # pragma: no cover
399+
except errors.APIError as e:
400400
if (status_code := e.code) >= 400:
401401
raise ModelHTTPError(status_code=status_code, model_name=self._model_name, body=e.details) from e
402402
raise # pragma: lax no cover

0 commit comments

Comments
 (0)