about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-05 14:02:52 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-05 14:02:52 -0700
commit8d00da889d54148eb591e67337799f4d1814a032 (patch)
tree2186aa704e10f7bb3c239d070ce608048174d231
parent26a98d027bfb4c65fbc0095b96b99e0732fcc671 (diff)
downloadlines.love-8d00da889d54148eb591e67337799f4d1814a032.tar.gz
better error message
https://tildegit.org/akkartik/lines.love/issues/1
-rw-r--r--file.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/file.lua b/file.lua
index d3ccca2..92561bd 100644
--- a/file.lua
+++ b/file.lua
@@ -30,6 +30,9 @@ end
 
 function save_to_disk(lines, filename)
   local outfile = App.open_for_writing(filename)
+  if outfile == nil then
+    error('failed to write to "'..filename..'"')
+  end
   for _,line in ipairs(lines) do
     if line.mode == 'drawing' then
       store_drawing(outfile, line)