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 2021/05/18 00:26:14 UTC

[GitHub] [superset] betodealmeida commented on a change in pull request #14677: feat: redirect 404/500 to static pages

betodealmeida commented on a change in pull request #14677:
URL: https://github.com/apache/superset/pull/14677#discussion_r633948559



##########
File path: superset/views/base.py
##########
@@ -364,6 +364,10 @@ def show_superset_errors(ex: SupersetErrorsException) -> FlaskResponse:
 @superset_app.errorhandler(HTTPException)
 def show_http_exception(ex: HTTPException) -> FlaskResponse:
     logger.warning(ex)
+    if not config["DEBUG"] and ex.code == 404:
+        return redirect("/static/assets/404.html")
+    if not config["DEBUG"] and ex.code == 500:
+        return redirect("/static/assets/500.html")

Review comment:
       I'll update this to redirect only non-API calls.




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



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