Fix crash when disk is full
This commit is contained in:
parent
9dbd819313
commit
80d963fab6
|
@ -14,7 +14,6 @@ const m3u8Regex* = re"""url="(.+.m3u8)""""
|
||||||
proc createMediaRouter*(cfg: Config) =
|
proc createMediaRouter*(cfg: Config) =
|
||||||
router media:
|
router media:
|
||||||
get "/pic/?":
|
get "/pic/?":
|
||||||
echo "empty pic"
|
|
||||||
resp Http404
|
resp Http404
|
||||||
|
|
||||||
get "/pic/@url":
|
get "/pic/@url":
|
||||||
|
@ -41,6 +40,9 @@ proc createMediaRouter*(cfg: Config) =
|
||||||
client.safeClose()
|
client.safeClose()
|
||||||
removeFile(filename)
|
removeFile(filename)
|
||||||
resp Http404
|
resp Http404
|
||||||
|
except OSError:
|
||||||
|
echo "Disk full"
|
||||||
|
resp Http404
|
||||||
finally:
|
finally:
|
||||||
client.safeClose()
|
client.safeClose()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue