Skip to content

Commit

Permalink
add exception to api blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Jun 13, 2018
1 parent 3ad4ddd commit d21d6a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ckan/views/api.py
Expand Up @@ -336,6 +336,13 @@ def action(logic_function, ver=API_DEFAULT_VERSION):
str(e)}
return_dict[u'success'] = False
return _finish(500, return_dict, content_type=u'json')
except Exception as e:
return_dict[u'error'] = {
u'__type': u'Internal Server Error',
u'message': u'Internal Server Error'}
return_dict[u'success'] = False
log.exception(e)
return _finish(500, return_dict, content_type=u'json')

return _finish_ok(return_dict)

Expand Down

0 comments on commit d21d6a8

Please sign in to comment.