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 {
|
if p.State() == livekit.ParticipantInfo_DISCONNECTED {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
sink := p.getResponseSink()
|
sink := p.getResponseSink()
|
||||||
if sink == nil {
|
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)
|
err := sink.WriteMessage(msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.params.Logger.Warnw("could not send message to participant", err,
|
p.params.Logger.Warnw("could not send message to participant", err,
|
||||||
|
|||||||
Reference in New Issue
Block a user