Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
66edb0d875
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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)