Răsfoiți Sursa

[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 ani în urmă
părinte
comite
1a49dfe5b8

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