From 8a397f84b95c6769d1a648e17553523ebbb761c8 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 28 May 2026 12:17:29 -0500 Subject: Convert exception objects to strings directly The .join(...) call assumes the arguments to the exception are always strings. This assumption is wrong, and leads to failure when attempting to report the previous failure. --- gn3/errors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3/errors.py') diff --git a/gn3/errors.py b/gn3/errors.py index f0d499e..e937653 100644 --- a/gn3/errors.py +++ b/gn3/errors.py @@ -72,7 +72,7 @@ def handle_authorisation_error(exc: AuthorisationError): logger.error("Handling external auth errors - %s", request.url) return jsonify(add_trace(exc, { "error": type(exc).__name__, - "error_description": " :: ".join(exc.args) + "error_description": str(exc) })), 401 @@ -130,7 +130,7 @@ def handle_local_authorisation_errors(exc: oautherrors.AuthorisationError): logger.error("Handling local auth errors - %s", request.url) return jsonify(add_trace(exc, { "error": type(exc).__name__, - "error_description": " ".join(exc.args) + "error_description": str(exc) })), 401 -- cgit 1.4.1