Handle error responses when creating proxy publisher / subscriber.

This commit is contained in:
Joachim Bauch 2022-08-30 11:49:08 +02:00
parent 960cb0ea3c
commit 9a868c6d91
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02

View file

@ -1042,6 +1042,8 @@ func (c *mcuProxyConnection) newPublisher(ctx context.Context, listener McuListe
if err != nil {
// TODO: Cancel request
return nil, err
} else if response.Type == "error" {
return nil, fmt.Errorf("Error creating %s publisher for %s on %s: %+v", streamType, id, c, response.Error)
}
proxyId := response.Command.Id
@ -1070,6 +1072,8 @@ func (c *mcuProxyConnection) newSubscriber(ctx context.Context, listener McuList
if err != nil {
// TODO: Cancel request
return nil, err
} else if response.Type == "error" {
return nil, fmt.Errorf("Error creating %s subscriber for %s on %s: %+v", streamType, publisherSessionId, c, response.Error)
}
proxyId := response.Command.Id