Properly catch aiohttp client exception. Ref #2228

This commit is contained in:
grossmj committed 2023-05-30 16:17:12 +09:30
1 parent 0f02cff5f2
commit 2361e138ec
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -150,9 +150,9 @@ class Docker(BaseManager):
data=data,
headers={"content-type": "application/json", },
timeout=timeout)
except (aiohttp.ClientResponseError, aiohttp.ClientOSError) as e:
except aiohttp.ClientError as e:
raise DockerError("Docker has returned an error: {}".format(str(e)))
except (asyncio.TimeoutError):
except asyncio.TimeoutError:
raise DockerError("Docker timeout " + method + " " + path)
if response.status >= 300:
body = await response.read()