Skip to content

Commit

Permalink
Update src/data_models/Game.py
Browse files Browse the repository at this point in the history
better error message while rules are broken

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
Alex-Kopylov and coderabbitai[bot] authored Apr 6, 2024
1 parent f924ab3 commit d068186
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data_models/Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def validate_player_distribution(
or total_liberals > max_liberals
or total_fascists > max_fascists
):
raise ValueError("Invalid player distribution according to game rules.")
raise ValueError(f"Invalid player distribution: {total_hitlers} Hitlers, {total_liberals} Liberals, {total_fascists} Fascists. Max allowed - Hitlers: {max_hitlers}, Liberals: {max_liberals}, Fascists: {max_fascists}.")

def check_mutually_exclusive_victory_conditions(
cls, outcomes_counter: Counter
Expand Down

0 comments on commit d068186

Please sign in to comment.