@@ -4,9 +4,9 @@ function appendResult(title, result)
44 var sheet = document.getElementById("sheet");
55 var template = document.getElementById("sectiontemplate").cloneNode(true);
66 template.removeAttribute("id");
7− var tutd = document.createElement("span");
8− tutd.textContent = title
9− template.getElementsByClassName("title")[0].appendChild(tutd);
7+ var titleSpan = document.createElement("span");
8+ titleSpan.textContent = title;
9+ template.getElementsByClassName("title")[0].appendChild(titleSpan);
1010 template.getElementsByClassName("result")[0].appendChild(result);
1111 if(result.nodeName == "TABLE") // show some relation statistics
1212 {
@@ -64,7 +64,7 @@ function connectOrDisconnect(form)
6464 //connect
6565 window.conn = new ProjectM36Connection(host, port, dbname,
6666 connectionOpened,
67− function(e) {console.log("connection error"+e)},
67+ connectionError,
6868 updateStatus,
6969 connectionClosed);
7070 toggleConnectionFields(form, false, "Connecting...");
@@ -72,6 +72,14 @@ function connectOrDisconnect(form)
7272 return false;
7373}
7474
75+function connectionError(event)
76+{
77+ var err = document.createElement("span");
78+ err.textContent = "Failed to connect to websocket server. Please check the connection parameters and try again.";
79+ appendResult("Connect", err);
80+ connectionClosed(event)
81+}
82+
7583function connectionClosed(event)
7684{
7785 toggleConnectionFields(document.getElementById("connection"), true, "Connect");