better error message

akkartik/lines.love#1
This commit is contained in:
Kartik K. Agaram 2022-07-05 14:02:52 -07:00
parent 26a98d027b
commit 8d00da889d
1 changed files with 3 additions and 0 deletions

View File

@ -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)