[CORD-1738] Propagating API errors trough chameleon
Change-Id: I64316a9e65df56b74670637463981eb78da93c04
diff --git a/.gitignore b/.gitignore
index e288c19..c69f216 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.idea
*.swp
# Generated files
diff --git a/web_server/web_server.py b/web_server/web_server.py
index e660b05..f817045 100644
--- a/web_server/web_server.py
+++ b/web_server/web_server.py
@@ -31,6 +31,7 @@
from OpenSSL.SSL import TLSv1_2_METHOD
from werkzeug.exceptions import BadRequest
from grpc import StatusCode
+import json
log = get_logger()
@@ -136,5 +137,6 @@
request.setResponseCode(403)
return failure.value.details()
else:
- raise
+ request.setResponseCode(500)
+ return json.dumps({'error': 'Internal Server Error', 'specific_error': failure.value.details()})