xep_0384: raise NoEligibleDevices all at once

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2018-11-30 17:11:06 +00:00
parent 8465936715
commit bc85bc7efd

View file

@ -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