diff options
author | Frederick Muriuki Muriithi | 2024-03-04 11:14:56 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-03-04 11:14:56 +0300 |
commit | 0b47330c16ea4e95afae9842070559f41f76c3da (patch) | |
tree | 895faa6a953556a30cbe0b8bc8ec1eef3e98f8f4 | |
parent | 48e9821b3ea31d27d2dd63a4fa7e304111ea1464 (diff) | |
download | genenetwork3-0b47330c16ea4e95afae9842070559f41f76c3da.tar.gz |
Check for exception args and provide traceback.
-rw-r--r-- | gn3/errors.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gn3/errors.py b/gn3/errors.py index 7a9d0be..1833bf6 100644 --- a/gn3/errors.py +++ b/gn3/errors.py @@ -98,7 +98,9 @@ def handle_generic(exc: Exception) -> Response: current_app.logger.error(exc) resp = jsonify({ "error": type(exc).__name__, - "error_description": exc.args[0], + "error_description": ( + exc.args[0] if bool(exc.args) else "Generic Exception"), + "trace": traceback.format_exc() }) resp.status_code = 500 return resp |