瀏覽代碼

HUE-6153 [hbase] Log debug instead of exception messages for fallback handling

Jenny Kim 8 年之前
父節點
當前提交
21ef6a6fc7
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      apps/hbase/src/hbase/api.py
  2. 2 2
      apps/hbase/src/hbase/views.py

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

@@ -63,7 +63,7 @@ class HbaseApi(object):
     try:
       full_config = json.loads(conf.HBASE_CLUSTERS.get().replace("'", "\""))
     except:
-      LOG.exception('failed to load the HBase clusters')
+      LOG.debug('Failed to read HBase cluster configuration as JSON, falling back to raw configuration.')
       full_config = [conf.HBASE_CLUSTERS.get()] #hack cause get() is weird
 
     for config in full_config:

+ 2 - 2
apps/hbase/src/hbase/views.py

@@ -55,7 +55,7 @@ def api_router(request, url): # On split, deserialize anything
     try:
       return json.loads(re.sub(r'(?:\")([0-9]+)(?:\")', r'\1', str(raw)))
     except:
-      LOG.exception('failed to parse input as json')
+      LOG.debug('Failed to parse input as JSON, falling back to raw input.')
       return raw
 
   def deserialize(data):
@@ -87,7 +87,7 @@ def api_dump(response):
       json.dumps(data)
       return data
     except:
-      LOG.exception('Failed to dump data as JSON')
+      LOG.debug('Failed to dump data as JSON, falling back to raw data.')
       cleaned = {}
       lim = [0]
       if isinstance(data, str): # Not JSON dumpable, meaning some sort of bytestring or byte data