From e68e006dcad03fc872a9c51cdda8e30733c03ee0 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Tue, 25 Apr 2017 13:23:19 -0500 Subject: [PATCH] Replace "database not found" error response with helpful message This is kludgy, we may change the way the message is displayed, or replace other raw error responses, we can revisit later. --- webui/assets/main.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/webui/assets/main.js b/webui/assets/main.js index a92ba8830..41efd6df2 100644 --- a/webui/assets/main.js +++ b/webui/assets/main.js @@ -93,11 +93,22 @@ class REPL { createSingleOutput(res) { var node = document.createElement("div"); node.classList.add('output'); + var output_string = res['output'] + var output_json = JSON.parse(output_string) var result_class = "result-output" - var output = JSON.parse(res['output']) - if("error" in output) { + + if("error" in output_json) { result_class = "result-error" + if(output_json['error'] == 'database not found') { // TODO db->index + output_string = `Error: index not found
+ $ curl -XPOST "http://127.0.0.1:10101/db/test" -d '{"options": {"columnLabel": "col"}}' # create a database
+ $ curl -XPOST "http://127.0.0.1:10101/db/test/frame/foo" -d '{"options": {"rowLabel": "row"}}' # create a frame
+ SetBit(row=0, col=0, frame=foo) # Use PQL to set a bit + ` + } } + + var markup =`
@@ -118,7 +129,7 @@ class REPL { ${res.querytime_ms} ms
- ${res.output} + ${output_string}