diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-08-02 17:38:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 17:38:24 +0100 |
commit | 1fa98495d0735093cb5e91a375b3b0516f5d58d6 (patch) | |
tree | 37be034fdef9706cb9c85e1ee132c351ea3b1397 /synapse/http/server.py | |
parent | Merge pull request #3638 from matrix-org/rav/refactor_federation_client_excep... (diff) | |
parent | changelog (diff) | |
download | synapse-1fa98495d0735093cb5e91a375b3b0516f5d58d6.tar.xz |
Merge pull request #3639 from matrix-org/rav/refactor_error_handling
Clean up handling of errors from outbound requests
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r-- | synapse/http/server.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py index 1940c1c4f4..6dacb31037 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -36,7 +36,6 @@ from synapse.api.errors import ( Codes, SynapseError, UnrecognizedRequestError, - cs_exception, ) from synapse.http.request_metrics import requests_counter from synapse.util.caches import intern_dict @@ -77,16 +76,13 @@ def wrap_json_request_handler(h): def wrapped_request_handler(self, request): try: yield h(self, request) - except CodeMessageException as e: + except SynapseError as e: code = e.code - if isinstance(e, SynapseError): - logger.info( - "%s SynapseError: %s - %s", request, code, e.msg - ) - else: - logger.exception(e) + logger.info( + "%s SynapseError: %s - %s", request, code, e.msg + ) respond_with_json( - request, code, cs_exception(e), send_cors=True, + request, code, e.error_dict(), send_cors=True, pretty_print=_request_user_agent_is_curl(request), ) |