Improve error handling and PWA manifest

This commit is contained in:
Ian Renton
2026-09-04 17:50:35 +01:00
parent d7202f208c
commit ab86bdc4d6
16 changed files with 33 additions and 26 deletions
+5 -2
View File
@@ -48,12 +48,15 @@ class Mode(str, Enum):
def from_name(name):
"""Convert a string to an enum mode using the alias table."""
if not name:
return Mode.UNKNOWN
try:
return Mode(name.upper())
except ValueError:
except (KeyError, ValueError):
try:
return Mode(MODE_ALIASES[name.upper()])
except ValueError:
except (KeyError, ValueError):
return Mode.UNKNOWN
+4 -1
View File
@@ -42,6 +42,9 @@ def infer_mode_type_from_mode(mode: str) -> ModeType:
if not mode:
return ModeType.UNKNOWN
if mode in MODE_ALIASES:
mode = MODE_ALIASES[mode]
try:
mode = Mode(mode.upper())
if mode.is_cw:
@@ -118,7 +121,7 @@ def get_callsign_object_from_pyhamtools_callinfo(callsign, callinfo):
country = data.get("country", None)
dxcc_id = data.get("adif", None)
continent = Continent(data.get("continent", None))
continent = Continent(data["continent"]) if "continent" in data else None
cq_zone = data.get("cqz", None)
itu_zone = data.get("ituz", None)
lat = float(data["latitude"]) if "latitude" in data else None