diff --git a/superset-frontend/src/assets/staticPages/404.html b/superset-frontend/src/assets/staticPages/404.html index 2b20e3d710..7fd9617a69 100644 --- a/superset-frontend/src/assets/staticPages/404.html +++ b/superset-frontend/src/assets/staticPages/404.html @@ -94,7 +94,7 @@

Page not found

- Sorry, we cannot find t he page you are looking for. You may have + Sorry, we cannot find the page you are looking for. You may have mistyped the address or the page may have moved.

Back to home diff --git a/superset/views/base.py b/superset/views/base.py index 23e9bb5a6a..d0b88748d9 100644 --- a/superset/views/base.py +++ b/superset/views/base.py @@ -385,6 +385,13 @@ def refresh_csrf_token(ex: CSRFError) -> FlaskResponse: @superset_app.errorhandler(HTTPException) def show_http_exception(ex: HTTPException) -> FlaskResponse: logger.warning(ex) + if ( + "text/html" in request.accept_mimetypes + and not config["DEBUG"] + and ex.code in {404, 500} + ): + return redirect(f"/static/assets/{ex.code}.html") + return json_errors_response( errors=[ SupersetError(