Fix crash when disk is full

This commit is contained in:
Zed 2020-06-02 19:58:24 +02:00
parent 9dbd819313
commit 80d963fab6

View file

@ -14,7 +14,6 @@ const m3u8Regex* = re"""url="(.+.m3u8)""""
proc createMediaRouter*(cfg: Config) =
router media:
get "/pic/?":
echo "empty pic"
resp Http404
get "/pic/@url":
@ -41,6 +40,9 @@ proc createMediaRouter*(cfg: Config) =
client.safeClose()
removeFile(filename)
resp Http404
except OSError:
echo "Disk full"
resp Http404
finally:
client.safeClose()