good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit cfdbc432 authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Improve wspb and wsjson helper subpackages

parent 8f01a85d
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ func read(ctx context.Context, c *websocket.Conn, v interface{}) error {
}
if typ != websocket.MessageText {
c.Close(websocket.StatusUnsupportedData, "can only accept text messages")
return xerrors.Errorf("unexpected frame type for json (expected %v): %v", websocket.MessageText, typ)
}
......
......@@ -30,6 +30,7 @@ func read(ctx context.Context, c *websocket.Conn, v proto.Message) error {
}
if typ != websocket.MessageBinary {
c.Close(websocket.StatusUnsupportedData, "can only accept binary messages")
return xerrors.Errorf("unexpected frame type for protobuf (expected %v): %v", websocket.MessageBinary, typ)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment