Skip to content

Commit b2571cb

Browse files
authored
Guard exceptions in on notification (#784)
1 parent b6dd433 commit b2571cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aioshelly/rpc_device/wsrpc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,12 @@ def handle_frame(self, source: RPCSource, frame: dict[str, Any]) -> None:
312312
else:
313313
# this is a notification
314314
_LOGGER.debug("Notification: %s %s", method, params)
315-
self._on_notification(source, method, params)
315+
try:
316+
self._on_notification(source, method, params)
317+
except Exception as err:
318+
_LOGGER.exception(
319+
"Error handling notification frame: %s", frame, exc_info=err
320+
)
316321

317322
return
318323

0 commit comments

Comments
 (0)