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:
Uli Schlachter 2017-04-02 18:58:03 +02:00
parent 48c15e4dfb
commit f1b78a6ff2
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ end
local function write_count_table(count_table)
count_table = count_table or instance.count_table
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
local str = string.format("%s;%d\n", name, count)
count_file:write(str)