♻️ Extract _try_fetch helper to collapse try/except duplication #47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/try-fetch-helper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pure, behavior-preserving refactor of
coordinator.py.Collapses the 4 repeated
try/except ComwattAuthError: raise / except Exception: <fallback>blocks (site time-series, device power, device energy, switch refresh) into a single_try_fetch(fn, *args)helper that re-raises auth errors and returnsNoneon any other failure. Call sites guard withis not None/or {}.