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