add file io error printing
This commit is contained in:
parent
ae6dd9f2bc
commit
c162f1c98c
@ -159,7 +159,8 @@ local function assembleCode(code, instrs)
|
||||
end
|
||||
|
||||
local function readFile(fn)
|
||||
local fi = io.open(fn, "r") or error("could not open file "..fn)
|
||||
local fi, err = io.open(fn, "r")
|
||||
if not fi then error("could not open file "..fn..": "..err) end
|
||||
local text = fi:read("*a")
|
||||
fi:close()
|
||||
return text
|
||||
|
Loading…
x
Reference in New Issue
Block a user