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

+12 -6
View File
@@ -343,12 +343,16 @@ class MicrophoneIndicator(Box):
if old is not None and old is not mic:
try:
old.disconnect_by_func(self._on_mic_stream_changed)
except Exception:
pass
except Exception as e:
logger.warning(
f"[indicators] old.disconnect_by_func(self._on_mic_stream_changed) failed: {e}"
)
try:
mic.disconnect_by_func(self._on_mic_stream_changed)
except Exception:
pass
except Exception as e:
logger.warning(
f"[indicators] mic.disconnect_by_func(self._on_mic_stream_changed) failed: {e}"
)
mic.connect("changed", self._on_mic_stream_changed)
self._mic_device = mic
self._sync_state()
@@ -386,8 +390,10 @@ class MicrophoneIndicator(Box):
self._hide_timer_id = 0
try:
self._audio.disconnect_by_func(self._on_mic_device_changed)
except Exception:
pass
except Exception as e:
logger.warning(
f"[indicators] self._audio.disconnect_by_func(self._on_mic_device_changed) failed: {e}"
)
old = getattr(self, "_mic_device", None)
target = old if old is not None else self._audio.microphone
if target is not None: