We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be8bfb5 commit 4b2ad72Copy full SHA for 4b2ad72
1 file changed
src/mistralai/async_client.py
@@ -201,15 +201,15 @@ async def _request(
201
202
try:
203
json_response: Dict[str, Any] = await response.json()
204
- except JSONDecodeError:
+ except JSONDecodeError as e:
205
raise MistralAPIException.from_aio_response(
206
response, message=f"Failed to decode json body: {await response.text()}"
207
- )
+ ) from e
208
except aiohttp.ClientPayloadError as e:
209
210
response,
211
message=f"An unexpected error occurred while receiving the response: {e}",
212
213
214
self._logger.debug(f"JSON response: {json_response}")
215
self._check_response(json_response, dict(response.headers), response.status)
0 commit comments