diff options
-rwxr-xr-x | api.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |