Merge pull request #1881 from psychon/menubar-desktop-parsing-error-messages
menubar: Produce better errors for broken .desktop files
This commit is contained in:
commit
71548de903
|
@ -305,10 +305,14 @@ function utils.parse_dir(dir_path, callback)
|
||||||
local file_child = enum:get_child(info)
|
local file_child = enum:get_child(info)
|
||||||
if file_type == 'REGULAR' then
|
if file_type == 'REGULAR' then
|
||||||
local path = file_child:get_path()
|
local path = file_child:get_path()
|
||||||
local program = path and utils.parse_desktop_file(path)
|
if path then
|
||||||
if program then
|
local success, program = pcall(utils.parse_desktop_file, path)
|
||||||
|
if not success then
|
||||||
|
gdebug.print_error("Error while reading '" .. path .. "': " .. program)
|
||||||
|
elseif program then
|
||||||
table.insert(programs, program)
|
table.insert(programs, program)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
elseif file_type == 'DIRECTORY' then
|
elseif file_type == 'DIRECTORY' then
|
||||||
parser(file_child, programs)
|
parser(file_child, programs)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue