mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Improve error message if track kind and modality mismatch (#230)
Co-authored-by: Marcus Valtonen Örnhag <marcus.valtonen.ornhag@ericsson.com>
This commit is contained in:
committed by
GitHub
parent
5636736c56
commit
1f0462371e
@@ -326,7 +326,11 @@ class WebRTCConnectionMixin:
|
|||||||
context=context,
|
context=context,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise ValueError("Modality must be either video, audio, or audio-video")
|
if self.modality not in ["video", "audio", "audio-video"]:
|
||||||
|
msg = "Modality must be either video, audio, or audio-video"
|
||||||
|
else:
|
||||||
|
msg = f"Unsupported track kind '{track.kind}' for modality '{self.modality}'"
|
||||||
|
raise ValueError(msg)
|
||||||
if body["webrtc_id"] not in self.connections:
|
if body["webrtc_id"] not in self.connections:
|
||||||
self.connections[body["webrtc_id"]] = []
|
self.connections[body["webrtc_id"]] = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user