From 9afd49e882bb27815daba1454b0569ffe7c8a67c Mon Sep 17 00:00:00 2001 From: jakedt Date: Tue, 25 Feb 2014 17:19:02 -0500 Subject: [PATCH] Leave ISEs as 400s, but log exceptions and have slightly improved error messages. --- endpoints/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoints/common.py b/endpoints/common.py index 77e155098..64dfd5e4f 100644 --- a/endpoints/common.py +++ b/endpoints/common.py @@ -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():