diff options
author | Frederick Muriuki Muriithi | 2024-08-01 15:07:02 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-08-01 15:07:02 -0500 |
commit | 13c14ade387e78e290267c055f24b035c9e2868c (patch) | |
tree | 811acbc22e841c2bd9c84f4c3f984d49e88d96f1 /gn_auth | |
parent | 4035317d4e1f12f575fc2df1f0a9e04d4d83dc48 (diff) | |
download | gn-auth-enable-key-rotation.tar.gz |
Handle generic exception and return a value.enable-key-rotation
Diffstat (limited to 'gn_auth')
-rw-r--r-- | gn_auth/auth/authorisation/resources/views.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py index d8ac431..19d3d9a 100644 --- a/gn_auth/auth/authorisation/resources/views.py +++ b/gn_auth/auth/authorisation/resources/views.py @@ -440,6 +440,14 @@ def resources_authorisation(): "Expected a JSON object with a 'resource-ids' key.") }) resp.status_code = 400 + except Exception as _exc: + app.logger.debug("Generic exception.", exc_info=True) + resp = jsonify({ + "status": "general-exception", + "error_description": ( + "Failed to fetch the user's privileges.") + }) + resp.status_code = 500 return resp |