Group onboard wireless steps and trace journalled Bluetooth failures
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user