This is an automated email from the ASF dual-hosted git repository.

tn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-atr-experiments.git


The following commit(s) were added to refs/heads/main by this push:
     new 68de839  revert 404 error page to the previous version with a 
different wording wrt the handling
68de839 is described below

commit 68de8394f8b2e980477f092a713a8b5b7d33edc9
Author: Thomas Neidhart <[email protected]>
AuthorDate: Fri Mar 7 11:20:35 2025 +0100

    revert 404 error page to the previous version with a different wording wrt 
the handling
---
 atr/server.py               |  3 +--
 atr/templates/notfound.html | 11 ++++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/atr/server.py b/atr/server.py
index a6b54f5..6552a59 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -25,7 +25,6 @@ from typing import Any
 from blockbuster import BlockBuster
 from quart import render_template
 from quart_schema import OpenAPIProvider, QuartSchema
-from werkzeug.exceptions import NotFound
 from werkzeug.routing import Rule
 
 import asfquart
@@ -67,7 +66,7 @@ def register_routes(app: QuartApp) -> tuple[str, ...]:
     # Add a global error handler in case a page does not exist.
     @app.errorhandler(404)
     async def handle_not_found(error: Exception) -> Any:
-        return await render_template("notfound.html", error=str(error), 
status_code=404), 404
+        return await render_template("notfound.html", error="404 Not Found", 
traceback="", status_code=404), 404
 
     # Must do this otherwise ruff "fixes" this function by removing the imports
     return (
diff --git a/atr/templates/notfound.html b/atr/templates/notfound.html
index 997c376..86077f7 100644
--- a/atr/templates/notfound.html
+++ b/atr/templates/notfound.html
@@ -32,13 +32,18 @@
 
 {% block content %}
   <div>
-    <h1>Page Not Found</h1>
+    <h1>Error</h1>
     <div class="error-container">
       <h2 class="error-title">{{ error }}</h2>
       <p>
-        The page you are looking for does not exist. How you get here is a 
mystery.
-        But you can click the link below to get back to the homepage.
+        The requested URL was not found on the server. If you entered the URL 
manually please check your spelling and try again.
       </p>
+
+      {% if status_code %}
+        <p>
+          <strong>Status Code:</strong> {{ status_code }}
+        </p>
+      {% endif %}
     </div>
 
     <div class="actions">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to