Leave ISEs as 400s, but log exceptions and have slightly improved error messages.

This commit is contained in:
jakedt 2014-02-25 17:19:02 -05:00
parent fa4c925e4d
commit 9afd49e882

View file

@ -58,13 +58,13 @@ def common_login(db_user):
@app.errorhandler(model.DataModelException)
def handle_dme(ex):
logger.exception(ex)
return make_response('Internal Server Error', 500)
return make_response(ex.message, 400)
@app.errorhandler(KeyError)
def handle_dme_key_error(ex):
logger.exception(ex)
return make_response('Internal Server Error', 500)
return make_response('Invalid key: %s' % ex.message, 400)
def generate_csrf_token():