Group onboard wireless steps and trace journalled Bluetooth failures

This commit is contained in:
DCCONSTRUCTIONS
2026-09-07 13:27:21 +03:00
parent a0732386f1
commit d7986cb62f
10 changed files with 217 additions and 27 deletions
@@ -147,7 +147,20 @@ class NodeBridge:
async def invoke_journalled(self, action: str, payload: dict, identifier: str) -> dict:
try:
return await self.invoke(action, payload, identifier)
except Exception:
except Exception as error:
# Journalled device failures are returned as normal operation
# results, so the HTTP exception logger never sees them. Record
# only source locations here; exception text may contain a frame.
logging.getLogger(__name__).warning(
"K1 journalled invocation failed: action=%s operation=%s exception=%s locations=%s",
action,
identifier,
type(error).__name__,
";".join(
f"{Path(frame.filename).name}:{frame.name}:{frame.lineno}"
for frame in traceback.extract_tb(error.__traceback__)[-10:]
),
)
# Read the exact result after a failure; never repeat an invocation
# or interpret an exception as evidence that a command was unsent.
result = await self.invoke("state.read", {}, identifier + "-observe")