From 1740ccbe30946aa6693a6a9ed8211a2ff7cfbf3d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 9 Jul 2025 11:51:37 -0500 Subject: Improve error handling and reporting. - Refactor out common functionality into reusable utilities - Handle errors from the Authlib library/package - Handle 4xx errors generically. --- gn_auth/templates/404.html | 13 ------------- gn_auth/templates/50x.html | 25 ------------------------- gn_auth/templates/http-error-4xx.html | 20 ++++++++++++++++++++ gn_auth/templates/http-error-5xx.html | 25 +++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 38 deletions(-) delete mode 100644 gn_auth/templates/404.html delete mode 100644 gn_auth/templates/50x.html create mode 100644 gn_auth/templates/http-error-4xx.html create mode 100644 gn_auth/templates/http-error-5xx.html (limited to 'gn_auth/templates') diff --git a/gn_auth/templates/404.html b/gn_auth/templates/404.html deleted file mode 100644 index e17bfe8..0000000 --- a/gn_auth/templates/404.html +++ /dev/null @@ -1,13 +0,0 @@ -{%extends "base.html"%} - -{%block title%}404: Page Not Found{%endblock%} - -{%block pagetitle%}404: Could Not Find the Requested Page{%endblock%} - -{%block content%} - -
- The page "{{page}}" does not exist on this server. -
- -{%endblock%} diff --git a/gn_auth/templates/50x.html b/gn_auth/templates/50x.html deleted file mode 100644 index 859a232..0000000 --- a/gn_auth/templates/50x.html +++ /dev/null @@ -1,25 +0,0 @@ -{%extends "base.html"%} - -{%block title%} -{{error.status_code or 500}}: {{error.description or "Generic Exception"}} -{%endblock%} - -{%block pagetitle%} -{{error.status_code or 500}}: {{error.description or "Generic Exception"}} -{%endblock%} - -{%block content%} - -The system has done something it should not! This is our fault.
- -- Please send us the details below to help us figure out what we did wrong and - fix it. -
- -URI: {{page}}
-{{"".join(trace)}}
-The system has done something it should not! This is our fault.
+ ++ Please send us the details below to help us figure out what we did wrong and + fix it. +
+ +URI: {{page}}
+{{"".join(trace)}}
+