menubar: assert() that io.open() succeeds
Improves-the-error-for: https://github.com/awesomeWM/awesome/issues/1663 Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
48c15e4dfb
commit
f1b78a6ff2
|
@ -146,7 +146,7 @@ end
|
||||||
local function write_count_table(count_table)
|
local function write_count_table(count_table)
|
||||||
count_table = count_table or instance.count_table
|
count_table = count_table or instance.count_table
|
||||||
local count_file_name = gfs.get_dir("cache") .. "/menu_count_file"
|
local count_file_name = gfs.get_dir("cache") .. "/menu_count_file"
|
||||||
local count_file = io.open (count_file_name, "w")
|
local count_file = assert(io.open(count_file_name, "w"))
|
||||||
for name, count in pairs(count_table) do
|
for name, count in pairs(count_table) do
|
||||||
local str = string.format("%s;%d\n", name, count)
|
local str = string.format("%s;%d\n", name, count)
|
||||||
count_file:write(str)
|
count_file:write(str)
|
||||||
|
|
Loading…
Reference in New Issue