summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-02-25 14:34:19 +0000
committerGitHub <noreply@github.com>2019-02-25 14:34:19 +0000
commit5b9786ee0099cb35a718e968b097fa85f0e076e3 (patch)
treefd38aa4f94a96034faf6133b3312cacb3ac4bd01 /synapse
parentMerge pull request #4716 from matrix-org/erikj/pusher_logging (diff)
parentNewsfile (diff)
downloadsynapse-5b9786ee0099cb35a718e968b097fa85f0e076e3.tar.xz
Merge pull request #4723 from matrix-org/erikj/frontend_proxy_exception
Correctly proxy exception in frontend_proxy worker
Diffstat (limited to 'synapse')
-rw-r--r--synapse/app/frontend_proxy.py15
1 files 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