Catch SSL shutdown errors when closing clients

This commit is contained in:
Zed
2020-01-01 17:24:24 +01:00
parent b09798f2cf
commit ee43d8cfb1
3 changed files with 11 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ proc createMediaRouter*(cfg: Config) =
let client = newAsyncHttpClient()
try:
await client.downloadFile($uri, filename)
client.close()
client.safeClose()
except HttpRequestError:
removeFile(filename)
resp Http404