handle errors when gps coordinates are out of range

This commit is contained in:
Jakob Ketterl
2021-09-30 23:03:21 +02:00
parent 460bada88f
commit 0b64b4ac97
2 changed files with 12 additions and 1 deletions

View File

@@ -2,6 +2,9 @@ from owrx.config import Config
from owrx.locator import Locator
from owrx.property import PropertyFilter
from owrx.property.filter import ByPropertyName
import logging
logger = logging.getLogger(__name__)
class ReceiverDetails(PropertyFilter):
@@ -20,5 +23,8 @@ class ReceiverDetails(PropertyFilter):
def __dict__(self):
receiver_info = super().__dict__()
receiver_info["locator"] = Locator.fromCoordinates(receiver_info["receiver_gps"])
try:
receiver_info["locator"] = Locator.fromCoordinates(receiver_info["receiver_gps"])
except ValueError as e:
logger.error("invalid receiver location, check in settings: %s", str(e))
return receiver_info