refactor: log swallowed exceptions across src/

Replace silent swallow-excepts (pass/return/continue) with
logger.warning recording the caught error, preserving behaviour.
This commit is contained in:
sankalp committed 2026-07-14 13:02:21 +05:45
1 parent c0a4b1b792
commit f72542a231
49 files changed
+1004 -363

No files matched your search

+11 -7
View File
@@ -1,4 +1,4 @@
from fabric.utils import Gdk, GLib
from fabric.utils import Gdk, GLib, logger
from fabric.widgets.box import Box
from fabric.widgets.button import Button
from fabric.widgets.label import Label
@@ -252,8 +252,8 @@ class ScreenCaptureWindow(Window):
if _handler_id[0] is not None:
try:
svc.disconnect(_handler_id[0])
except Exception:
pass
except Exception as e:
logger.warning(f"[main] svc.disconnect(_handler_id[0]) failed: {e}")
_handler_id[0] = None
# Re-show only on cancel (path is None)
if not path:
@@ -265,8 +265,10 @@ class ScreenCaptureWindow(Window):
if _handler_id[0] is not None:
try:
screen_capture_service.disconnect(_handler_id[0])
except Exception:
pass
except Exception as e:
logger.warning(
f"[main] screen_capture_service.disconnect(_handler_id[0]) failed: {e}"
)
_handler_id[0] = None
return False
@@ -284,8 +286,10 @@ class ScreenCaptureWindow(Window):
if _handler_id[0] is not None:
try:
screen_capture_service.disconnect(_handler_id[0])
except Exception:
pass
except Exception as e:
logger.warning(
f"[main] screen_capture_service.disconnect(_handler_id[0]) failed: {e}"
)
_handler_id[0] = None
GLib.timeout_add(120, self.show)