diff --git a/superset-frontend/src/assets/staticPages/404_custom.html b/superset-frontend/src/assets/staticPages/404_custom.html new file mode 100644 index 0000000000000..a1eded97aec0f --- /dev/null +++ b/superset-frontend/src/assets/staticPages/404_custom.html @@ -0,0 +1,122 @@ + + + + + 404 - Page not found + + + +
+
+ + + + + +
+ +

404

+

Page not found

+ +

Report via Jira:

+ Jira + helpdesk +
+ + diff --git a/superset-frontend/src/assets/staticPages/500_custom.html b/superset-frontend/src/assets/staticPages/500_custom.html new file mode 100644 index 0000000000000..19f0915a54ad2 --- /dev/null +++ b/superset-frontend/src/assets/staticPages/500_custom.html @@ -0,0 +1,123 @@ + + + + + 500 - Internal server error + + + +
+
+ + + + + +
+ +

500

+

Internal Server Error

+ +

Report via Jira:

+ Jira + helpdesk +
+ + diff --git a/superset-frontend/webpack.config.js b/superset-frontend/webpack.config.js index f8428e4418fbb..4bccbc5058f2d 100644 --- a/superset-frontend/webpack.config.js +++ b/superset-frontend/webpack.config.js @@ -128,16 +128,16 @@ const plugins = [ // static pages new HtmlWebpackPlugin({ - template: './src/assets/staticPages/404.html', + template: './src/assets/staticPages/404_custom.html', inject: true, chunks: [], - filename: '404.html', + filename: '404_custom.html', }), new HtmlWebpackPlugin({ - template: './src/assets/staticPages/500.html', + template: './src/assets/staticPages/500_custom.html', inject: true, chunks: [], - filename: '500.html', + filename: '500_custom.html', }), ]; diff --git a/superset/views/base.py b/superset/views/base.py index ec74b8ccdb3a0..6e9b8935acc63 100644 --- a/superset/views/base.py +++ b/superset/views/base.py @@ -507,7 +507,7 @@ def show_http_exception(ex: HTTPException) -> FlaskResponse: def show_command_errors(ex: CommandException) -> FlaskResponse: logger.warning("CommandException", exc_info=True) if "text/html" in request.accept_mimetypes and not config["DEBUG"]: - path = resource_filename("superset", "static/assets/500.html") + path = resource_filename("superset", "static/assets/500_custom.html") return send_file(path, cache_timeout=0), 500 extra = ex.normalized_messages() if isinstance(ex, CommandInvalidError) else {} @@ -529,7 +529,7 @@ def show_command_errors(ex: CommandException) -> FlaskResponse: def show_unexpected_exception(ex: Exception) -> FlaskResponse: logger.exception(ex) if "text/html" in request.accept_mimetypes and not config["DEBUG"]: - path = resource_filename("superset", "static/assets/500.html") + path = resource_filename("superset", "static/assets/500_custom.html") return send_file(path, cache_timeout=0), 500 return json_errors_response(