Skip to content
Snippets Groups Projects
Verified Commit dbb4e226 authored by Filip Hron's avatar Filip Hron
Browse files

fixup! errors: return JSON instead of HTML from flask

parent 50f49153
No related merge requests found
......@@ -115,4 +115,3 @@ venv.bak/
/reforis_static/reforis/js/app.min.js.LICENSE.txt
/reforis_static/reforis/css/app.css
/js/styleguide/
.vscode/**
......@@ -111,7 +111,7 @@ def create_app(config):
def _wrap_error(error, code):
if isinstance(error, dict):
return dict({'status': code}, **error)
return {'status': code, 'error': 'Error:{!r}'.format(error)}
return {'status': code, 'error': 'Error:{!r}'.format(error)}, code
def not_found_error(error):
......@@ -119,7 +119,7 @@ def not_found_error(error):
def internal_error(error):
return _wrap_error(error, 500)
return render_template('errors/500.html', error=error), 500
def foris_controller_error(e):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment