Skip to content
This repository was archived by the owner on Aug 19, 2018. It is now read-only.

Commit 9dfb72a

Browse files
committed
Added clientresponseerror handling
1 parent 8caa779 commit 9dfb72a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crasync/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ def close(self):
5353

5454
async def request(self, url):
5555
async with self.session.get(url) as resp:
56-
data = await resp.json()
56+
try:
57+
data = await resp.json()
58+
except (asyncio.TimeoutError, aiohttp.ClientResponseError):
59+
raise ServerError(resp, {})
5760

5861
# Request was successful
5962
if 300 > resp.status >= 200:

0 commit comments

Comments
 (0)