瀏覽代碼

HUE-1932 [hbase] Better error message when HBase Thrift server is not there

New error like:
"HBase Thrift 1 server cannot be contacted: Could not connect to localhost:9090"
Romain Rigaux 11 年之前
父節點
當前提交
66edb0d875
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      apps/hbase/src/hbase/api.py

+ 4 - 1
apps/hbase/src/hbase/api.py

@@ -44,7 +44,10 @@ class HbaseApi(object):
       cluster = args[0]
       return self.queryCluster(action, cluster, *args[1:])
     except Exception, e:
-      raise PopupException(_("Api Error: %s") % e.message)
+      if 'Could not connect to' in e.message:
+        raise PopupException(_("HBase Thrift 1 server cannot be contacted: %s") % e.message)
+      else:
+        raise PopupException(_("Api Error: %s") % e.message)
 
   def queryCluster(self, action, cluster, *args):
     client = self.connectCluster(cluster)