aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/resources
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-08-01 15:07:02 -0500
committerFrederick Muriuki Muriithi2024-08-01 15:07:02 -0500
commit13c14ade387e78e290267c055f24b035c9e2868c (patch)
tree811acbc22e841c2bd9c84f4c3f984d49e88d96f1 /gn_auth/auth/authorisation/resources
parent4035317d4e1f12f575fc2df1f0a9e04d4d83dc48 (diff)
downloadgn-auth-enable-key-rotation.tar.gz
Handle generic exception and return a value.enable-key-rotation
Diffstat (limited to 'gn_auth/auth/authorisation/resources')
-rw-r--r--gn_auth/auth/authorisation/resources/views.py8
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