refactor(modules): improve exception handling and simplify service usage

Enhancements
- Replace bare `except:` with `except Exception:` in multiple modules- Cast step calculation to `int` for consistent type
- Simplify `get_battery_icon_file` to return a string directly
- Use `get_todo_service()` instead of module-level `todo_service` throughout todo widget
- Remove unused `"zen": "zen-browser"` mapping entry

Bug Fixes
- Prevent bare exception swallowing by catching `Exception` explicitly
- Ensure proper cleanup of timer IDs and other resources
- Delete unused modules/osdd components

New Features
- None
This commit is contained in:
sankalp committed 2026-03-23 23:34:03 +05:45
1 parent 34cfb2f49e
commit ef4065bc1f
34 files changed
+682 -519

No files matched your search

+3 -3
View File
@@ -29,7 +29,7 @@ class BookmarkManager:
try:
parsed = urlparse(url)
return f"{parsed.scheme}://{parsed.netloc}/favicon.ico"
except:
except Exception:
return ""
def _extract_domain(self, url: str) -> str:
@@ -41,7 +41,7 @@ class BookmarkManager:
if domain.startswith("www."):
domain = domain[4:]
return domain
except:
except Exception:
return url
def _normalize_url(self, url: str) -> str:
@@ -683,7 +683,7 @@ class BookmarksPlugin(PluginBase):
if domain.startswith("www."):
domain = domain[4:]
return domain
except:
except Exception:
return url
def _open_bookmark(self, url: str):