Skip to content

Commit d1c2126

Browse files
committed
fix(api): broaden exception handling in ducking bot callback
Catch all exceptions in _on_data_received() instead of only JSONDecodeError and AttributeError, preventing UnicodeDecodeError or TypeError from crashing the LiveKit event loop.
1 parent 641f0e9 commit d1c2126

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • apps/api/src/lib/livekit

apps/api/src/lib/livekit/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _on_data_received(self, data_packet: Any) -> None:
7373
else:
7474
self.ducking_active.clear()
7575
logger.info("ducking_deactivated", room=self.room_name)
76-
except (json.JSONDecodeError, AttributeError):
76+
except Exception:
7777
logger.warning("ducking_invalid_data_packet", room=self.room_name)
7878

7979
async def publish_location(

0 commit comments

Comments
 (0)