Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support update #126

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
18 changes: 12 additions & 6 deletions backend/static/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ function appendRuntimeInformation(runtime_info, query, time, queryUpdate) {
}

// Add query time to meta info.
runtime_info["meta"]["total_time_computing"] =
parseInt(time["computeResult"].toString().replace(/ms/, ""), 10);
if ("computeResult" in time) {
runtime_info["meta"]["total_time_computing"] =
parseInt(time["computeResult"].toString().replace(/ms/, ""), 10);
}
runtime_info["meta"]["total_time"] =
parseInt(time["total"].toString().replace(/ms/, ""), 10);

Expand Down Expand Up @@ -755,6 +757,12 @@ function expandEditor() {
}
}

function displayInErrorBlock(message) {
$('#errorReason').html(message);
$('#errorBlock').show();
$('#answerBlock, #infoBlock, #updatedBlock').hide();
}

function displayError(response, queryId = undefined) {
console.error("Either the GET request failed or the backend returned an error:", response);
if (response["exception"] == undefined || response["exception"] == "") {
Expand Down Expand Up @@ -782,9 +790,7 @@ function displayError(response, queryId = undefined) {
queryToDisplay = htmlEscape(queryToDisplay);
}
disp += "Your query was: " + "<br><pre>" + queryToDisplay + "</pre>";
$('#errorReason').html(disp);
$('#errorBlock').show();
$('#answerBlock, #infoBlock').hide();
displayInErrorBlock(disp);

// If error response contains query and runtime info, append to runtime log.
//
Expand All @@ -811,7 +817,7 @@ function displayWarning(result) {
}

function displayStatus(str) {
$("#errorBlock,#answerBlock,#warningBlock").hide();
$("#errorBlock,#answerBlock,#warningBlock,#updatedBlock").hide();
$("#info").html(str);
$("#infoBlock").show();
}
Expand Down
Loading