diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-12 18:17:11 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-12 18:17:11 +0000 |
commit | 963256638d5b3c3edee14bfbd7c00944b45d04c0 (patch) | |
tree | 1dea83e095f847f538dc0aa3b1aad47e55b60788 /scripts/federation_client.py | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-963256638d5b3c3edee14bfbd7c00944b45d04c0.tar.xz |
Correctly handle all the places that can throw exceptions
Diffstat (limited to 'scripts/federation_client.py')
-rw-r--r-- | scripts/federation_client.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/federation_client.py b/scripts/federation_client.py index 3139c61761..ea62dceb36 100644 --- a/scripts/federation_client.py +++ b/scripts/federation_client.py @@ -97,8 +97,11 @@ def lookup(destination, path): if ":" in destination: return "https://%s%s" % (destination, path) else: - srv = srvlookup.lookup("matrix", "tcp", destination)[0] - return "https://%s:%d%s" % (srv.host, srv.port, path) + try: + srv = srvlookup.lookup("matrix", "tcp", destination)[0] + return "https://%s:%d%s" % (srv.host, srv.port, path) + except: + return "https://%s:%d%s" % (destination, 8448, path) def get_json(origin_name, origin_key, destination, path): request_json = { |