refactor(src/window):improve error handling with logging

This commit is contained in:
sankalp committed 2026-06-17 05:21:36 +05:45
1 parent 420688e9a7
commit 9cbde2c58f
26 files changed
+239 -211

No files matched your search

+7 -6
View File
@@ -1,3 +1,4 @@
from fabric.utils import logger
from fabric.system_tray.widgets import SystemTray
from fabric.widgets.box import Box
from fabric.widgets.button import Button
@@ -312,8 +313,8 @@ class Panel(Window):
if self._on_config_changed in _config_handlers:
_config_handlers.remove(self._on_config_changed)
except Exception:
pass
except Exception as e:
logger.error(f"An error occurred: {e}")
# Destroy components
for component in [
@@ -324,14 +325,14 @@ class Panel(Window):
]:
try:
component.destroy()
except Exception:
pass
except Exception as e:
logger.error(f"An error occurred: {e}")
# Destroy MouseCapture windows
for mc in [self.control_center, self.notification_center]:
try:
mc.destroy()
except Exception:
pass
except Exception as e:
logger.error(f"An error occurred: {e}")
super().destroy()