Skip to content

Commit 82609da

Browse files
committed
Also ignore occasional json decode error in battlesnake
1 parent 2ea90af commit 82609da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

codeclash/games/battlesnake/battlesnake.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ def get_results(self, agents: list[Player], round_num: int, stats: RoundStats):
129129
scores[winner] = scores.get(winner, 0) + 1
130130
except FileNotFoundError:
131131
self.logger.warning(f"Simulation {idx} not found, skipping")
132+
except json.JSONDecodeError:
133+
self.logger.warning(f"Simulation {idx} is not a valid JSON, skipping")
132134
else:
133135
self.logger.warning(f"Only one player ({available_players[0]}) started, giving them the win")
134136
# We didn't run a game, so we just give the one player the win

0 commit comments

Comments
 (0)