Harden JSON event parsing and broadcast message formatting

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
Debian
2026-09-13 14:00:13 +02:00
co-authored by Sisyphus
parent 15d461c234
commit e47badb7b3
2 changed files with 7 additions and 5 deletions
+1 -2
View File
@@ -84,7 +84,7 @@ class EventParser:
except json.JSONDecodeError as e:
logger.debug(f'JSON decode error: {e}')
return None
except (KeyError, TypeError) as e:
except (KeyError, TypeError, ValueError) as e:
logger.debug(f'Error parsing event: {e}')
return None
@@ -212,7 +212,6 @@ class EventParser:
else:
weapon_name = WEAPON_NAMES.get(weapon, weapon)
return f"{score_prefix}{killer_prefix}^8{killer_name}^0 ^7committed suicide with the ^7{weapon_name}{warmup}\n"
return None
# Regular kill: +1 for killer
if not data.get('WARMUP', False):