Skip to content

Commit

Permalink
Merge pull request #75 from cmu-sei/next
Browse files Browse the repository at this point in the history
3.6.8
  • Loading branch information
sei-mkaar authored Nov 18, 2022
2 parents 734fa12 + 2dcfea4 commit 5eef9d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Gameboard.Api/Features/UnityGames/UnityGameExceptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace Gameboard.Api.Features.UnityGames;

Expand All @@ -7,7 +9,7 @@ public class TeamHasNoPlayersException : Exception { }

internal class ChallengeResolutionFailure : GameboardException
{
public ChallengeResolutionFailure(string teamId) : base($"Couldn't resolve a Unity challenge for team {teamId}") { }
public ChallengeResolutionFailure(string teamId, IEnumerable<string> challengeIds) : base($"Couldn't resolve a Unity challenge for team {teamId}. They have {challengeIds.Count()} challenges ({String.Join(" | ", challengeIds)})") { }
}

internal class SemaphoreLockFailure : GameboardException
Expand Down
2 changes: 1 addition & 1 deletion src/Gameboard.Api/Features/UnityGames/UnityGameService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public async Task DeleteChallengeData(string gameId)

if (challengeCandidates.Count() != 1)
{
throw new ChallengeResolutionFailure(model.TeamId);
throw new ChallengeResolutionFailure(model.TeamId, challengeCandidates.Select(c => c.Id));
}

// if we return null to the controller above, it interprets this as an "ok cool, we already have this one"
Expand Down

0 comments on commit 5eef9d2

Please sign in to comment.