From 47a7e3928d103b88ede86fb742cd05d092f5ee62 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Sat, 23 Feb 2019 15:17:57 +0000 Subject: Correctly proxy exception in frontend_proxy worker --- synapse/app/frontend_proxy.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/synapse/app/frontend_proxy.py b/synapse/app/frontend_proxy.py index d5b954361d..8479fee738 100644 --- a/synapse/app/frontend_proxy.py +++ b/synapse/app/frontend_proxy.py @@ -21,7 +21,7 @@ from twisted.web.resource import NoResource import synapse from synapse import events -from synapse.api.errors import SynapseError +from synapse.api.errors import HttpResponseException, SynapseError from synapse.app import _base from synapse.config._base import ConfigError from synapse.config.homeserver import HomeServerConfig @@ -66,10 +66,15 @@ class PresenceStatusStubServlet(ClientV1RestServlet): headers = { "Authorization": auth_headers, } - result = yield self.http_client.get_json( - self.main_uri + request.uri.decode('ascii'), - headers=headers, - ) + + try: + result = yield self.http_client.get_json( + self.main_uri + request.uri.decode('ascii'), + headers=headers, + ) + except HttpResponseException as e: + raise e.to_synapse_error() + defer.returnValue((200, result)) @defer.inlineCallbacks -- cgit 1.4.1 From 21d3f82344275b957c7e6c8496e418d085722d22 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Sat, 23 Feb 2019 15:18:38 +0000 Subject: Newsfile --- changelog.d/4723.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4723.misc diff --git a/changelog.d/4723.misc b/changelog.d/4723.misc new file mode 100644 index 0000000000..96958036ca --- /dev/null +++ b/changelog.d/4723.misc @@ -0,0 +1 @@ +Correctly proxy exception in frontend_proxy worker -- cgit 1.4.1