summary refs log tree commit diff
path: root/synapse/http/server.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-05-10 12:10:27 +0100
committerRichard van der Hoff <richard@matrix.org>2018-05-10 12:19:53 +0100
commit645cb4bf06deee1c4c10ecc3d7df2c914168f19a (patch)
treed7c6f45ee742673f80fd88af9e7eb5a4e6b46ec1 /synapse/http/server.py
parentFactor wrap_request_handler_with_logging out of wrap_request_handler (diff)
downloadsynapse-645cb4bf06deee1c4c10ecc3d7df2c914168f19a.tar.xz
Remove redundant request_handler decorator
This is needless complexity; we might as well use the wrapper directly.

Also rename wrap_request_handler->wrap_json_request_handler.
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r--synapse/http/server.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index fd58e65c4b..f29e36f490 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -45,12 +45,7 @@ import simplejson
 logger = logging.getLogger(__name__)
 
 
-def request_handler():
-    """Decorator for ``wrap_request_handler``"""
-    return wrap_request_handler
-
-
-def wrap_request_handler(h):
+def wrap_json_request_handler(h):
     """Wraps a request handler method with exception handling.
 
     Also adds logging as per wrap_request_handler_with_logging.
@@ -213,7 +208,7 @@ class JsonResource(HttpServer, resource.Resource):
         self._async_render(request)
         return server.NOT_DONE_YET
 
-    @request_handler()
+    @wrap_json_request_handler
     @defer.inlineCallbacks
     def _async_render(self, request):
         """ This gets called from render() every time someone sends us a request.