Skip to content
Snippets Groups Projects
Commit efa4ccfa authored by Richard van der Hoff's avatar Richard van der Hoff
Browse files

E2E key query: handle federation fails

Don't fail the whole request if we can't connect to a particular server.
parent 0d81e267
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
import ujson as json
import logging
import twisted.internet.error
from canonicaljson import encode_canonical_json
from twisted.internet import defer
......@@ -111,6 +112,11 @@ class E2eKeysHandler(object):
failures[destination] = {
"status": 503, "message": "Not ready for retry",
}
except Exception as e:
# include ConnectionRefused and other errors
failures[destination] = {
"status": 503, "message": e.message
}
yield preserve_context_over_deferred(defer.gatherResults([
preserve_fn(do_remote_query)(destination)
......@@ -222,6 +228,11 @@ class E2eKeysHandler(object):
failures[destination] = {
"status": 503, "message": "Not ready for retry",
}
except Exception as e:
# include ConnectionRefused and other errors
failures[destination] = {
"status": 503, "message": e.message
}
yield preserve_context_over_deferred(defer.gatherResults([
preserve_fn(claim_client_keys)(destination)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment