aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/websocket.js
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim/webui/static/js/websocket.js')
-rw-r--r--fg21sim/webui/static/js/websocket.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/fg21sim/webui/static/js/websocket.js b/fg21sim/webui/static/js/websocket.js
index b0fe1b9..2fa26d8 100644
--- a/fg21sim/webui/static/js/websocket.js
+++ b/fg21sim/webui/static/js/websocket.js
@@ -127,27 +127,17 @@ var connectWebSocket = function (url) {
};
g_ws.onmessage = function (e) {
var msg = JSON.parse(e.data);
- console.log("WebSocket received message: type:", msg.type,
- ", success:", msg.success);
- console.log(msg);
+ console.log("WebSocket received message:", msg);
// Delegate appropriate actions to handle the received message
if (msg.type === "configs") {
handleWebSocketMsgConfigs(msg);
- }
- else if (msg.type === "console") {
+ } else if (msg.type === "console") {
handleWebSocketMsgConsole(msg);
- }
- else if (msg.type === "results") {
+ } else if (msg.type === "results") {
console.error("NotImplementedError");
- // handleMsgResults(msg);
- }
- else {
+ } else {
// Unknown/unsupported message type
- console.error("WebSocket received message of unknown type:", msg.type);
- if (! msg.success) {
- console.error("WebSocket request failed with error:", msg.error);
- // TODO: add error codes support and handle each specific error
- }
+ console.warn("WebSocket: unknown message type:", msg.type);
}
};
};