catch api exceptions due to workaround with timestamp format in nightscout (#71)

This commit is contained in:
James Woglom
2022-12-12 22:36:46 -05:00
parent 62f1322ef6
commit cabbc783c7
+11 -2
View File
@@ -77,9 +77,18 @@ class NightscoutApi:
return j[0]
return None
ret = internal(False)
ret = None
try:
ret = internal(False)
except ApiException as e:
logger.warning("last_uploaded_entry with no t_to_space: %s", e)
ret = None
if ret is None and (time_start or time_end):
ret = internal(True)
try:
ret = internal(True)
except ApiException as e:
logger.warning("last_uploaded_entry with t_to_space: %s", e)
ret = None
if ret is not None:
logger.warning("last_uploaded_entry with eventType=%s time_start=%s time_end=%s only returned data when timestamps contained a space" % (eventType, time_start, time_end))
return ret