Browse Source

HUE-8016 [notebook] Avoid to have function address in error log

Prevent:
ERROR    Error running <function check_status at 0x7f18a251af50>

Instead have :
ERROR    Error running check_status
Romain Rigaux 7 years ago
parent
commit
1cd10d5916
1 changed files with 2 additions and 2 deletions
  1. 2 2
      desktop/libs/notebook/src/notebook/decorators.py

+ 2 - 2
desktop/libs/notebook/src/notebook/decorators.py

@@ -113,7 +113,7 @@ def api_error_handler(func):
       response['status'] = 2
       response['status'] = 2
       response['message'] = e.message
       response['message'] = e.message
     except QueryError, e:
     except QueryError, e:
-      LOG.exception('Error running %s' % func)
+      LOG.exception('Error running %s' % func.__name__)
       response['status'] = 1
       response['status'] = 1
       response['message'] = smart_unicode(e)
       response['message'] = smart_unicode(e)
       if response['message'].index("max_row_size"):
       if response['message'].index("max_row_size"):
@@ -137,7 +137,7 @@ def api_error_handler(func):
       response['status'] = 1
       response['status'] = 1
       response['message'] = message.get('error')
       response['message'] = message.get('error')
     except Exception, e:
     except Exception, e:
-      LOG.exception('Error running %s' % func)
+      LOG.exception('Error running %s' % func.__name__)
       response['status'] = -1
       response['status'] = -1
       response['message'] = smart_unicode(e)
       response['message'] = smart_unicode(e)
     finally:
     finally: