Skip to content

Commit

Permalink
Fix crash when disk is full
Browse files Browse the repository at this point in the history
  • Loading branch information
zedeus committed Jun 2, 2020
1 parent 9dbd819 commit 80d963f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/media.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -41,6 +40,9 @@ proc createMediaRouter*(cfg: Config) =
client.safeClose()
removeFile(filename)
resp Http404
except OSError:
echo "Disk full"
resp Http404
finally:
client.safeClose()

Expand Down

0 comments on commit 80d963f

Please sign in to comment.