You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/08/21 01:27:01 UTC

[GitHub] [incubator-superset] mistercrunch commented on a change in pull request #7751: Show generic error msg and hide stacktrace if feature flag is enabled

mistercrunch commented on a change in pull request #7751: Show generic error msg and hide stacktrace if feature flag is enabled
URL: https://github.com/apache/incubator-superset/pull/7751#discussion_r315966958
 
 

 ##########
 File path: superset/views/base.py
 ##########
 @@ -63,9 +63,12 @@ def get_error_msg():
 
 
 def json_error_response(msg=None, status=500, stacktrace=None, payload=None, link=None):
+    stack_enabled = conf.get('SHOW_STACKTRACE')
+    if not stack_enabled:
+        msg = 'An error has occurred.'
     if not payload:
         payload = {'error': '{}'.format(msg)}
-        if stacktrace:
+        if stacktrace and stack_enabled:
 
 Review comment:
   I think this should call `superset.views.base.get_error_msg` somehow, and `get_error_msg` should probably get renamed to `get_stacktrace` ...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org