fix: Handle error when writing device metadata to WebRTC signaling channel

This commit is contained in:
Adam Shiervani 2025-04-08 22:34:55 +02:00
parent 443cf5d029
commit fd6bf90735
1 changed files with 5 additions and 1 deletions

6
web.go
View File

@ -145,7 +145,11 @@ func handleLocalWebRTCSignal(c *gin.Context) {
// Now use conn for websocket operations
defer wsCon.Close(websocket.StatusNormalClosure, "")
wsjson.Write(context.Background(), wsCon, gin.H{"type": "device-metadata", "data": gin.H{"deviceVersion": builtAppVersion}})
err = wsjson.Write(context.Background(), wsCon, gin.H{"type": "device-metadata", "data": gin.H{"deviceVersion": builtAppVersion}})
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
err = handleWebRTCSignalWsMessages(wsCon, false, source)
if err != nil {