Skip to content

Commit 41632be

Browse files
Merge pull request #319 from vozhyk-/handle-json-decode-error-for-404
AsyncRestSession: Fix handling JSONDecodeError for 404
2 parents a764256 + e0afbcf commit 41632be

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

meraki/aio/rest_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ async def _request(self, metadata, method, url, **kwargs):
240240
message_is_dict = True
241241
else:
242242
message_is_dict = False
243-
except aiohttp.client_exceptions.ContentTypeError:
243+
except (
244+
json.decoder.JSONDecodeError,
245+
aiohttp.client_exceptions.ContentTypeError,
246+
):
244247
message_is_dict = False
245248
try:
246249
message = (await response.text())[:100]

0 commit comments

Comments
 (0)