(self, session_id: str, message: str)
| 131 | logging.warning("Heartbeat request from disconnected session: %s", session_id) |
| 132 | |
| 133 | async def handle_message(self, session_id: str, message: str) -> None: |
| 134 | try: |
| 135 | data = json.loads(message) |
| 136 | await self.message_handler.handle_message(session_id, data, self) |
| 137 | except json.JSONDecodeError: |
| 138 | await self.send_message( |
| 139 | session_id, |
| 140 | {"type": "error", "data": {"message": "Invalid JSON format"}}, |
| 141 | ) |
| 142 | except Exception as exc: |
| 143 | logging.error("Error handling message from %s: %s", session_id, exc) |
| 144 | await self.send_message( |
| 145 | session_id, |
| 146 | {"type": "error", "data": {"message": str(exc)}}, |
| 147 | ) |
nothing calls this directly
no test coverage detected