Catch failed guest token exception

This commit is contained in:
Zed
2020-01-10 18:18:22 +01:00
parent 23647f1d7f
commit 0924ea033d
2 changed files with 8 additions and 2 deletions

View File

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