From 1677db2e4b81b96216a6a2d416ed2f7151267d44 Mon Sep 17 00:00:00 2001 From: Lennart Buit Date: Sat, 28 Nov 2015 10:19:14 +0100 Subject: [PATCH] Do not call signals.got_request_exception for expected exceptions. Subclasses of jsonrpc.exceptions.Error are used to return JSONRPC error responses in well defined situations and should not call the got_request_exception signal used for uncaught exceptions. This is similar to the behaviour of the Django Http404 exception. --- jsonrpc/site.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jsonrpc/site.py b/jsonrpc/site.py index e0b8e1f..609b6c9 100644 --- a/jsonrpc/site.py +++ b/jsonrpc/site.py @@ -201,8 +201,6 @@ def response_dict(self, request, D, status = 200 except Error as e: - signals.got_request_exception.send(sender=self.__class__, - request=request) response['error'] = e.json_rpc_format if version in ('1.1', '2.0') and 'result' in response: response.pop('result') @@ -265,8 +263,6 @@ def dispatch(self, request, method='', json_encoder=None): json_rpc = dumps(response, cls=json_encoder) except Error as e: - signals.got_request_exception.send(sender=self.__class__, - request=request) response['error'] = e.json_rpc_format status = e.status json_rpc = dumps(response, cls=json_encoder)