about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-10 10:15:54 -0500
committerFrederick Muriuki Muriithi2024-06-10 10:15:54 -0500
commitf9e58648801f173e935485c87de5bf33b0dfc356 (patch)
tree1e55244f85c686780b18063fd55003c80dc05987
parentc3b179f46e75e92de942a2d45d49c74cb887efc8 (diff)
downloadgn-auth-f9e58648801f173e935485c87de5bf33b0dfc356.tar.gz
Return error code in error handlers.
-rw-r--r--gn_auth/errors.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn_auth/errors.py b/gn_auth/errors.py
index 7b6ad33..1a48b9e 100644
--- a/gn_auth/errors.py
+++ b/gn_auth/errors.py
@@ -21,9 +21,9 @@ def page_not_found(exc):
             "error": exc.name,
             "error_description": (f"The page '{request.url}' does not exist on "
                                   "this server.")
-        })), 404
+        })), exc.code
 
-    return render_template("404.html", page=request.url)
+    return render_template("404.html", page=request.url), exc.code
 
 def handle_authorisation_error(exc: AuthorisationError):
     """Handle AuthorisationError if not handled anywhere else."""