Browse Source

Handle xdg-lib exceptions and log them as error, instead of crashing

master
Nils 3 months ago
parent
commit
c82f5991b9
  1. 6
      engine/findprograms.py

6
engine/findprograms.py

@ -100,7 +100,11 @@ class SupportedProgramsDatabase(object):
pass
for f in basePath.glob('**/*'):
if f.is_file() and f.suffix == ".desktop":
desktopEntry = xdg.DesktopEntry.DesktopEntry(f)
try: #the xdg lib will still raise errors when encountering a malformed .desktop file
desktopEntry = xdg.DesktopEntry.DesktopEntry(f)
except Exception as e:
logger.error(f"Desktop file {f} has problems: {e}")
continue
"""
#Don't validate. This is over-zealous and will mark deprecation and unknown categories.

Loading…
Cancel
Save