Эх сурвалжийг харах

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 жил өмнө
parent
commit
66edb0d875

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