diff options
author | David Baker <dbkr@users.noreply.github.com> | 2017-05-03 11:23:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 11:23:25 +0100 |
commit | 60833c8978d9f25c2d6c59c809c9b14a8f7e89e7 (patch) | |
tree | 1678fc6711c54fecfe94b4608f47a2f6d4ff5529 /synapse/handlers | |
parent | Merge pull request #2175 from matrix-org/erikj/prefill_state (diff) | |
parent | No need for the exception variable (diff) | |
download | synapse-60833c8978d9f25c2d6c59c809c9b14a8f7e89e7.tar.xz |
Merge pull request #2147 from matrix-org/dbkr/http_request_propagate_error
Propagate errors sensibly from proxied IS requests
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/identity.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py index 6a53c5eb47..9efcdff1d6 100644 --- a/synapse/handlers/identity.py +++ b/synapse/handlers/identity.py @@ -18,7 +18,7 @@ from twisted.internet import defer from synapse.api.errors import ( - CodeMessageException + MatrixCodeMessageException, CodeMessageException ) from ._base import BaseHandler from synapse.util.async import run_on_reactor @@ -90,6 +90,9 @@ class IdentityHandler(BaseHandler): ), {'sid': creds['sid'], 'client_secret': client_secret} ) + except MatrixCodeMessageException as e: + logger.info("getValidated3pid failed with Matrix error: %r", e) + raise SynapseError(e.code, e.msg, e.errcode) except CodeMessageException as e: data = json.loads(e.msg) @@ -159,6 +162,9 @@ class IdentityHandler(BaseHandler): params ) defer.returnValue(data) + except MatrixCodeMessageException as e: + logger.info("Proxied requestToken failed with Matrix error: %r", e) + raise SynapseError(e.code, e.msg, e.errcode) except CodeMessageException as e: logger.info("Proxied requestToken failed: %r", e) raise e @@ -193,6 +199,9 @@ class IdentityHandler(BaseHandler): params ) defer.returnValue(data) + except MatrixCodeMessageException as e: + logger.info("Proxied requestToken failed with Matrix error: %r", e) + raise SynapseError(e.code, e.msg, e.errcode) except CodeMessageException as e: logger.info("Proxied requestToken failed: %r", e) raise e |