Skip to content

Commit

Permalink
fix(errors): properly assign APIError.body (#949)
Browse files Browse the repository at this point in the history
Co-authored-by: Hao Cen <hao_cen@Haos-MacBook-Pro.local>
  • Loading branch information
cenhao and Hao Cen committed Dec 8, 2023
1 parent 54f0ce0 commit c70e194
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/openai/_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self, message: str, request: httpx.Request, *, body: object | None)
super().__init__(message)
self.request = request
self.message = message
self.body = body

if is_dict(body):
self.code = cast(Any, body.get("code"))
Expand Down

0 comments on commit c70e194

Please sign in to comment.