From 9710a5e9bbc7dd6b6d5f3a50b81f143c30604c30 Mon Sep 17 00:00:00 2001 From: A_D Date: Fri, 18 Sep 2020 23:18:10 +0200 Subject: [PATCH] repalced assert with log and continue --- plugins/edsm.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index 8a2e09c4..d84696d1 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -518,7 +518,13 @@ def worker() -> None: r.raise_for_status() this.discardedEvents = set(r.json()) this.discardedEvents.discard('Docked') # should_send() assumes that we send 'Docked' events - assert this.discardedEvents # wouldn't expect this to be empty + if not this.discardedEvents: + logger.error( + 'Unexpected empty discarded events list from EDSM. Bailing out of send: ' + f'{type(this.discardedEvents)} -- {this.discardedEvents}' + ) + continue + # Filter out unwanted events pending = list(filter(lambda x: x['event'] not in this.discardedEvents, pending))