浏览代码

HUE-8042 [editor] Avoid 500 error when the previous query handle was missing

Romain Rigaux 7 年之前
父节点
当前提交
bcbb954820
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

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

@@ -355,8 +355,8 @@ class HS2Api(Api):
     if (snippet['type'] == 'hive' and beeswax_conf.CLOSE_QUERIES.get()) or (snippet['type'] == 'impala' and impala_conf.CLOSE_QUERIES.get()):
       db = self._get_db(snippet)
 
-      handle = self._get_handle(snippet)
       try:
+        handle = self._get_handle(snippet)
         db.close_operation(handle)
       except Exception, e:
         if 'no valid handle' in str(e):