瀏覽代碼

HUE-7530 [editor] Avoid red error popup on close of expired query

Romain Rigaux 8 年之前
父節點
當前提交
c797f0d

+ 7 - 1
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -348,7 +348,13 @@ class HS2Api(Api):
       db = self._get_db(snippet)
 
       handle = self._get_handle(snippet)
-      db.close_operation(handle)
+      try:
+        db.close_operation(handle)
+      except Exception, e:
+        if 'no valid handle' in str(e):
+          return {'status': -1}  # skipped
+        else:
+          raise e
       return {'status': 0}
     else:
       return {'status': -1}  # skipped

+ 2 - 2
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1788,11 +1788,11 @@ var EditorViewModel = (function() {
         if (data.status == 0) {
           // self.status('closed'); // Keep as 'running' as currently it happens before running a new query
         } else {
-          self._ajaxError(data);
+          // self._ajaxError(data);
         }
       }).fail(function (xhr, textStatus, errorThrown) {
         if (xhr.status !== 502) {
-          $(document).trigger("error", xhr.responseText);
+          // $(document).trigger("error", xhr.responseText);
         }
         self.status('failed');
       });