mirror of
https://github.com/livekit/livekit.git
synced 2026-04-05 01:35:47 +00:00
Log and return error on no response sink. (#937)
* Log and return error on no response sink. * Clean up
This commit is contained in:
@@ -174,10 +174,15 @@ func (p *ParticipantImpl) writeMessage(msg *livekit.SignalResponse) error {
|
||||
if p.State() == livekit.ParticipantInfo_DISCONNECTED {
|
||||
return nil
|
||||
}
|
||||
|
||||
sink := p.getResponseSink()
|
||||
if sink == nil {
|
||||
return nil
|
||||
err := fmt.Errorf("no response sink")
|
||||
p.params.Logger.Warnw("could not send message to participant", err,
|
||||
"message", fmt.Sprintf("%T", msg.Message))
|
||||
return err
|
||||
}
|
||||
|
||||
err := sink.WriteMessage(msg)
|
||||
if err != nil {
|
||||
p.params.Logger.Warnw("could not send message to participant", err,
|
||||
|
||||
Reference in New Issue
Block a user