Better error messages when using the API, index and registry

This commit is contained in:
Joseph Schorr 2014-01-24 14:12:04 -05:00
parent 335733ad68
commit 98109a28cd
4 changed files with 142 additions and 102 deletions

View file

@ -52,6 +52,19 @@ def generate_headers(role='read'):
return decorator_method
@index.errorhandler(404)
def fallback_not_found(e):
return make_response('Not Found', 404)
@index.errorhandler(403)
def fallback_forbidden(e):
return make_response('Forbidden', 403)
@index.errorhandler(400)
def fallback_invalid_request(e):
return make_response('Invalid Request', 400)
@index.route('/users', methods=['POST'])
@index.route('/users/', methods=['POST'])
def create_user():