Преглед изворни кода

[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");