> Do we not need to trap the LogicException here? I had thought that we would
> need to do so, as well as ignoring otherwise broken .desktop files which are
> just text but not .desktop files.
We don't need to trap that exception, because the .has_group() method is declared noexcept, and if the DESKTOP_FILE_GROUP is not present then that's enough to catch every case. I'm testing for that with the broken.desktop file, which has 100 bytes of zero, and with semi-broken.desktop, which has just a text line, and with the has_group() fix both cases are handled well.
> Do we not need to trap the LogicException here? I had thought that we would
> need to do so, as well as ignoring otherwise broken .desktop files which are
> just text but not .desktop files.
We don't need to trap that exception, because the .has_group() method is declared noexcept, and if the DESKTOP_FILE_GROUP is not present then that's enough to catch every case. I'm testing for that with the broken.desktop file, which has 100 bytes of zero, and with semi-broken. desktop, which has just a text line, and with the has_group() fix both cases are handled well.