apply TRY lint
This commit is contained in:
@@ -60,10 +60,11 @@ class EmptySplash(Gtk.Box):
|
||||
def load_image(self, file_path: str) -> GdkPixbuf.Pixbuf | None:
|
||||
try:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(file_path)
|
||||
return pixbuf
|
||||
except Exception as e:
|
||||
log.error(f"Failed to load image: {e}")
|
||||
except Exception:
|
||||
log.exception("Failed to load image")
|
||||
return None
|
||||
else:
|
||||
return pixbuf
|
||||
|
||||
def _on_join(self, button: Gtk.Button, entry: Gtk.Entry) -> None:
|
||||
"""
|
||||
|
||||
@@ -280,8 +280,8 @@ class VMObject(GObject.Object):
|
||||
if not self._log_file:
|
||||
try:
|
||||
self._log_file = Path(proc.out_file).open() # noqa: SIM115
|
||||
except Exception as ex:
|
||||
log.exception(ex)
|
||||
except Exception:
|
||||
log.exception(f"Failed to open log file {proc.out_file}")
|
||||
self._log_file = None
|
||||
return GLib.SOURCE_REMOVE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user