瀏覽代碼

[notebook] Show fetch log errors in the log instead of query error

Some SQL version do not or are not configure to report the query logs,
instead of erroring out big in red for each log call, it is better
to just append those to the optional log panel.
Romain Rigaux 10 年之前
父節點
當前提交
1a49dfe5b8
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 4 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -574,6 +574,10 @@ var Snippet = function (vm, notebook, snippet) {
       snippet: ko.mapping.toJSON(self.getContext()),
       from: self.result.logLines
     }, function (data) {
+      if (data.status == 1) { // Append errors to the logs
+    	data.status = 0;
+    	data.logs = data.message;
+      }
       if (data.status == 0) {
         if (data.logs.length > 0) {
           var logs = data.logs.split("\n");