Send error response when update metadata fails. (#2849)

Keeping it simple for the first implementation.
- Send error response only if request_id != 0
- Two kinds of errors notified
  o does not have permissions - NOT_ALLOWED
  o attributes exceeds size limits -  INVALID_ARGUMENT
This commit is contained in:
Raja Subramanian
2024-07-10 23:26:44 +05:30
committed by GitHub
parent 40d7a8add0
commit b8847cd8e9
4 changed files with 106 additions and 0 deletions
+12
View File
@@ -197,6 +197,18 @@ func (p *ParticipantImpl) SendRefreshToken(token string) error {
})
}
func (p *ParticipantImpl) SendErrorResponse(errorResponse *livekit.ErrorResponse) error {
if errorResponse.RequestId == 0 {
return nil
}
return p.writeMessage(&livekit.SignalResponse{
Message: &livekit.SignalResponse_ErrorResponse{
ErrorResponse: errorResponse,
},
})
}
func (p *ParticipantImpl) HandleReconnectAndSendResponse(reconnectReason livekit.ReconnectReason, reconnectResponse *livekit.ReconnectResponse) error {
p.TransportManager.HandleClientReconnect(reconnectReason)