From df5bf40fc20699f9baeb8ae09c7495cbce8d42a8 Mon Sep 17 00:00:00 2001 From: Justin Schembri Date: Mon, 7 Apr 2025 14:03:26 +0400 Subject: [PATCH] handle more error types --- src/sensorthings_utils/netatmo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sensorthings_utils/netatmo.py b/src/sensorthings_utils/netatmo.py index b9cfcfa..0c9314c 100644 --- a/src/sensorthings_utils/netatmo.py +++ b/src/sensorthings_utils/netatmo.py @@ -99,7 +99,9 @@ def _extract( try: weather_station_data = ln.WeatherStationData(AUTHENTICATION) break - except TimeoutError as e: + # catching a type error is not strictly correct, see + # PR: https://github.com/philippelt/netatmo-api-python/pull/100 + except (TimeoutError, TypeError) as e: if attempt == MAX_CONNECTION_RETRIES - 1: logging.critical( f"Netatmo sensor link down {e} - NO DATA BEING COLLECTED."