From bc85bc7efd41ba0eb51d110edb380c13fa4e37ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 30 Nov 2018 17:11:06 +0000 Subject: [PATCH] xep_0384: raise NoEligibleDevices all at once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index cc35166..f9a9c9e 100644 --- a/plugin.py +++ b/plugin.py @@ -314,6 +314,8 @@ class XEP_0384(BasePlugin): break for (exn, key, val) in errors: + no_eligible_devices = [] + if isinstance(exn, MissingBundleException): bundle = await self._fetch_bundle(key, val) if bundle is not None: @@ -334,7 +336,10 @@ class XEP_0384(BasePlugin): if any(self._fetching_bundle(key, *err) for err in errors): continue - raise NoEligibleDevices(key) + no_eligible_devices.append(key) + + if no_eligible_devices: + raise NoEligibleDevices(no_eligible_devices) break