diff options
author | John Nduli | 2024-08-15 14:13:37 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-08-15 10:22:57 -0500 |
commit | 30611d4b7c3ca59ff5eca858b79ea0fe60c6a311 (patch) | |
tree | 8c3ac9b0d1ba5595f0ba1997e4b15c9b70ace8ec /gn_auth/errors.py | |
parent | 263707c72f823d437106f579ad974775ad427ccc (diff) | |
download | gn-auth-30611d4b7c3ca59ff5eca858b79ea0fe60c6a311.tar.gz |
fix: cast args to str
Diffstat (limited to 'gn_auth/errors.py')
-rw-r--r-- | gn_auth/errors.py | 3 |
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 |