mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(homeassistant): preserve exception tracebacks in error/warning logs
Three `logger.error` / `logger.warning` calls inside `except Exception as e:` blocks log only the exception's string. When the Home Assistant WebSocket connect, read loop, or reconnect fails in production, logs show the error message but drop the traceback — making it hard to tell whether a transport bug, an auth issue, or a library regression is the cause. Add `exc_info=True` to the connect, WS-read error, and reconnect sites.
This commit is contained in:
parent
73bccc94c7
commit
48e71626c7
1 changed files with 3 additions and 3 deletions
|
|
@ -134,7 +134,7 @@ class HomeAssistantAdapter(BasePlatformAdapter):
|
|||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error("[%s] Failed to connect: %s", self.name, e)
|
||||
logger.error("[%s] Failed to connect: %s", self.name, e, exc_info=True)
|
||||
return False
|
||||
|
||||
async def _ws_connect(self) -> bool:
|
||||
|
|
@ -224,7 +224,7 @@ class HomeAssistantAdapter(BasePlatformAdapter):
|
|||
except asyncio.CancelledError:
|
||||
return
|
||||
except Exception as e:
|
||||
logger.warning("[%s] WebSocket error: %s", self.name, e)
|
||||
logger.warning("[%s] WebSocket error: %s", self.name, e, exc_info=True)
|
||||
|
||||
if not self._running:
|
||||
return
|
||||
|
|
@ -242,7 +242,7 @@ class HomeAssistantAdapter(BasePlatformAdapter):
|
|||
backoff_idx = 0 # Reset on successful reconnect
|
||||
logger.info("[%s] Reconnected", self.name)
|
||||
except Exception as e:
|
||||
logger.warning("[%s] Reconnection failed: %s", self.name, e)
|
||||
logger.warning("[%s] Reconnection failed: %s", self.name, e, exc_info=True)
|
||||
|
||||
async def _read_events(self) -> None:
|
||||
"""Read events from WebSocket until disconnected."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue