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

+8 -3
View File
@@ -146,7 +146,10 @@ class WeatherService(Service):
if isinstance(data, list) and data:
try:
coords = (float(data[0]["lat"]), float(data[0]["lon"]))
except (ValueError, KeyError):
except (ValueError, KeyError) as e:
logger.warning(
f"[widget] coords = (float(data[0]['lat']), float(data[0]['lon'])) failed: {e}"
)
return None
self._coords = coords
self._coords_location = city
@@ -325,8 +328,10 @@ class Weather(Box):
"""Disconnect from the weather service (the service is app-lifetime)."""
try:
self._service.disconnect_by_func(self._on_service_update)
except ValueError:
pass
except ValueError as e:
logger.warning(
f"[widget] self._service.disconnect_by_func(self._on_service_update) failed: {e}"
)
super().destroy()