summaryrefslogtreecommitdiff
path: root/src/rhimportd/ctrlWebSocket.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-04-13 16:14:35 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-04-13 16:14:35 (GMT)
commit65a9d2c8d9eb7d4880ee1527de54fa212035af10 (patch)
tree5b4b9a3e75cc19c379c1b34397bb9d8bb4dbda4f /src/rhimportd/ctrlWebSocket.go
parentac0be16f3b36a739a7b6d9ab4863eb9efaf0da4d (diff)
send websocket response after json unmarshal error
Diffstat (limited to 'src/rhimportd/ctrlWebSocket.go')
-rw-r--r--src/rhimportd/ctrlWebSocket.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rhimportd/ctrlWebSocket.go b/src/rhimportd/ctrlWebSocket.go
index 35b285b..be7dcc0 100644
--- a/src/rhimportd/ctrlWebSocket.go
+++ b/src/rhimportd/ctrlWebSocket.go
@@ -323,6 +323,7 @@ func webSocketHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport
reqdata := newWebSocketRequestData(conf)
if err := ws.ReadJSON(&reqdata); err != nil {
rhdl.Println("WebSocket Client", ws.RemoteAddr(), "disconnected:", err)
+ sendWebSocketErrorResponse(ws, http.StatusBadRequest, err.Error())
return
} else {
// rhdl.Printf("Websocket Client %s got: %+v", ws.RemoteAddr(), reqdata)