From d78fcba4fbcf7962dbe775c1b010628bc69e5ca4 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Tue, 27 Dec 2022 10:37:34 +0100 Subject: [PATCH] catching explorer type error --- tnc/explorer.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tnc/explorer.py b/tnc/explorer.py index 3bb135b5..f84b69f5 100644 --- a/tnc/explorer.py +++ b/tnc/explorer.py @@ -46,10 +46,13 @@ class explorer(): station_data = {'callsign': callsign, 'gridsquare': gridsquare, 'frequency': frequency, 'band': band, 'version': version, 'bandwidth': bandwidth, 'beacon': beacon, "lastheard": []} for i in static.HEARD_STATIONS: - callsign = str(i[0], "UTF-8") - grid = str(i[1], "UTF-8") - snr = i[4].split("/")[1] - station_data["lastheard"].append({"callsign": callsign, "grid": grid, "snr": snr}) + try: + callsign = str(i[0], "UTF-8") + grid = str(i[1], "UTF-8") + snr = i[4].split("/")[1] + station_data["lastheard"].append({"callsign": callsign, "grid": grid, "snr": snr}) + except Exception as e: + log.debug("[EXPLORER] not publishing station", e=e) station_data = json.dumps(station_data) try: