diff --git a/endpoints/api.py b/endpoints/api.py index db3fe6ed0..5548f62b9 100644 --- a/endpoints/api.py +++ b/endpoints/api.py @@ -55,30 +55,6 @@ def csrf_protect(): req_user) -@api.errorhandler(404) -def endpoint_not_found(e): - return jsonify({ - 'error_code': 404, - 'message': 'Resource not found' - }) - - -@api.errorhandler(403) -def endpoint_forbidden(e): - return jsonify({ - 'error_code': 403, - 'message': 'Permission Denied' - }) - - -@api.errorhandler(400) -def endpoint_invalid_request(e): - return jsonify({ - 'error_code': 400, - 'message': 'Invalid Request' - }) - - def request_error(exception=None, **kwargs): data = kwargs.copy() if exception: diff --git a/endpoints/index.py b/endpoints/index.py index 94a5d4fef..998a0f94d 100644 --- a/endpoints/index.py +++ b/endpoints/index.py @@ -55,19 +55,6 @@ 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(): diff --git a/endpoints/registry.py b/endpoints/registry.py index 27c98d44e..7d126d8c3 100644 --- a/endpoints/registry.py +++ b/endpoints/registry.py @@ -23,19 +23,6 @@ store = app.config['STORAGE'] logger = logging.getLogger(__name__) -@registry.errorhandler(404) -def fallback_not_found(e): - return make_response('Not Found', 404) - -@registry.errorhandler(403) -def fallback_forbidden(e): - return make_response('Forbidden', 403) - -@registry.errorhandler(400) -def fallback_invalid_request(e): - return make_response('Invalid Request', 400) - - class SocketReader(object): def __init__(self, fp): self._fp = fp