mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 04:47:53 +00:00
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.
This commit is contained in:
parent
67d0180b8b
commit
e68e006dca
1 changed files with 14 additions and 3 deletions
|
|
@ -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<br />
|
||||
$ curl -XPOST "http://127.0.0.1:10101/db/test" -d '{"options": {"columnLabel": "col"}}' # create a database<br />
|
||||
$ curl -XPOST "http://127.0.0.1:10101/db/test/frame/foo" -d '{"options": {"rowLabel": "row"}}' # create a frame<br />
|
||||
SetBit(row=0, col=0, frame=foo) # Use PQL to set a bit
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var markup =`
|
||||
<div class="panes">
|
||||
<div class="pane active">
|
||||
|
|
@ -118,7 +129,7 @@ class REPL {
|
|||
<em>${res.querytime_ms} ms</em>
|
||||
</div>
|
||||
<div class="${result_class}">
|
||||
${res.output}
|
||||
${output_string}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue