Skip to content

Commit

Permalink
Improve clarity of late start error (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein authored Jan 29, 2024
1 parent 13e971a commit 7a4e050
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Gameboard.Api/Features/Player/PlayerExceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Gameboard.Api.Features.Player;

internal class CantLateStart : GameboardValidationException
{
internal CantLateStart(string captainPlayerId, string gameId, DateTimeOffset gameEnd, int sessionLength)
: base($"Can't start team {captainPlayerId} in game {gameId}. The game ends at {gameEnd}, which is within a session length of {sessionLength} minutes from now.") { }
internal CantLateStart(string teamName, string gameName, DateTimeOffset gameEnd, int sessionLength)
: base($"Can't start team {teamName} in game {gameName}. The game ends at {gameEnd}, which is within a session length of {sessionLength} minutes from now.") { }
}

internal class CantResolveTeamFromCode : GameboardException
Expand Down
2 changes: 1 addition & 1 deletion src/Gameboard.Api/Features/Player/PlayerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public async Task<Player> StartSession(SessionStartRequest model, User actor, bo

// rule: if the player/team is starting late, this must be allowed on the game level
if (sessionWindow.IsLateStart && !game.AllowLateStart)
throw new CantLateStart(player.Id, game.Id, game.GameEnd, game.SessionMinutes);
throw new CantLateStart(player.Name, game.Name, game.GameEnd, game.SessionMinutes);

foreach (var p in team)
{
Expand Down

0 comments on commit 7a4e050

Please sign in to comment.