From f6b990a00a2cf107d2a9a8dba49163c1ff9e411a Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 2 Feb 2026 17:04:33 +0000 Subject: [PATCH] Add user-friendly explanation to 404 error template --- rad/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rad/views.py b/rad/views.py index 2ac1bd86..c5146ad1 100644 --- a/rad/views.py +++ b/rad/views.py @@ -686,7 +686,10 @@ def stats(request): # HTTP Error 400 def page_not_found(request, exception): - response = render(request, "404.html") + # Provide the exception message (reason) to the template so callers + # can show a user-friendly explanation when available. + context = {"reason": str(exception) if exception is not None else "Not found"} + response = render(request, "404.html", context=context) response.status_code = 404