summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapi.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/api.py b/api.py
index bbdc7d7..7804f9d 100755
--- a/api.py
+++ b/api.py
@@ -137,7 +137,11 @@ class API:
if self._checker.access_is_allowed(r.headers, required_scopes):
logging.info('Access is allowed: %s %s', r.method, r.path)
- ret = func(**kwargs)
+ try:
+ ret = func(**kwargs)
+ except Exception as e:
+ logging.warning('Caught exception: %s', str(e))
+ return bottle.httpError(500)
logging.info('Result: %r', ret)
return ret