From 30611d4b7c3ca59ff5eca858b79ea0fe60c6a311 Mon Sep 17 00:00:00 2001 From: John Nduli Date: Thu, 15 Aug 2024 14:13:37 +0300 Subject: fix: cast args to str --- gn_auth/errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gn_auth/errors.py') 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 -- cgit v1.2.3