Skip to content

Commit 73b49d1

Browse files
committed
Raise ValueError instead of TypeError for previously set stream handlers
1 parent a412b3d commit 73b49d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

livekit-rtc/livekit/rtc/room.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def set_byte_stream_handler(self, handler: ByteStreamHandler, topic: str = ""):
431431
if existing_handler is None:
432432
self._byte_stream_handlers[topic] = handler
433433
else:
434-
raise TypeError("byte stream handler for topic '%s' already set" % topic)
434+
raise ValueError("byte stream handler for topic '%s' already set" % topic)
435435

436436
def remove_byte_stream_handler(self, topic: str = ""):
437437
if self._byte_stream_handlers.get(topic):
@@ -442,7 +442,7 @@ def set_text_stream_handler(self, handler: TextStreamHandler, topic: str = ""):
442442
if existing_handler is None:
443443
self._text_stream_handlers[topic] = handler
444444
else:
445-
raise TypeError("text stream handler for topic '%s' already set" % topic)
445+
raise ValueError("text stream handler for topic '%s' already set" % topic)
446446

447447
def remove_text_stream_handler(self, topic: str = ""):
448448
if self._text_stream_handlers.get(topic):

0 commit comments

Comments
 (0)