about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Nduli2024-08-15 14:13:37 +0300
committerFrederick Muriuki Muriithi2024-08-15 10:22:57 -0500
commit30611d4b7c3ca59ff5eca858b79ea0fe60c6a311 (patch)
tree8c3ac9b0d1ba5595f0ba1997e4b15c9b70ace8ec
parent263707c72f823d437106f579ad974775ad427ccc (diff)
downloadgn-auth-30611d4b7c3ca59ff5eca858b79ea0fe60c6a311.tar.gz
fix: cast args to str
-rw-r--r--gn_auth/errors.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gn_auth/errors.py b/gn_auth/errors.py
index 496b85c..4b6007a 100644
--- a/gn_auth/errors.py
+++ b/gn_auth/errors.py
@@ -35,8 +35,9 @@ def handle_general_exception(exc: Exception):
     current_app.logger.error("Error occurred!", exc_info=True)
     content_type = request.content_type
     if bool(content_type) and content_type.lower() == "application/json":
+        exc_args = [str(x) for x in exc.args]
         msg = ("The following exception was raised while attempting to access "
-               f"{request.url}: {' '.join(exc.args)}")
+               f"{request.url}: {' '.join(exc_args)}")
         return jsonify(add_trace(exc, {
             "error": type(exc).__name__,
             "error_description": msg