Skip to content

Commit

Permalink
api/ws- log unhandled events to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Apr 17, 2022
1 parent 6275df4 commit fae8888
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/handler/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package handler
import (
"net/http"

"github.com/nektro/go-util/util"
"github.com/nektro/mantle/pkg/db"
"github.com/nektro/mantle/pkg/handler/controls"
"github.com/nektro/mantle/pkg/ws"
Expand Down Expand Up @@ -50,6 +51,8 @@ func Websocket(w http.ResponseWriter, r *http.Request) {
wuser.SendMessage(c, string(smg.GetStringBytes("message")))
case "voice-connect", "voice-disconnect", "voice-data":
ws.BroadcastMessageRaw(smg)
default:
util.LogError("ws: unhandled event discarded: %s", string(smg.GetStringBytes("type")))
}
}

Expand Down

0 comments on commit fae8888

Please sign in to comment.