|
local f = assert(io.open("my_secret_file", { code = 123, message = "database could not be opened" }))
assert(io.open("my_secret_file"))works because in case of error io.open returns nil, err so you would like to change io.open also to return a predefined table?!