Skip to content

Commit f02edec

Browse files
chore: update error msgs
1 parent 7f242a0 commit f02edec

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/stackr/transitions.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,9 @@ const penaltyShootout: STF<League, MatchRequest> = {
279279
throw new Error("SHOOTOUT_ALREADY_STARTED");
280280
}
281281

282-
const teamScores = { ...match.scores };
283-
const [a, b] = Object.keys(teamScores);
284-
if (teamScores[a] !== teamScores[b]) {
285-
throw new Error("MATCH_NOT_DRAWN");
282+
const [a, b] = Object.keys(match.scores);
283+
if (match.scores[a] !== match.scores[b]) {
284+
throw new Error("SCORES_NOT_EQUAL");
286285
}
287286

288287
match.penaltyStartTime = block.timestamp;
@@ -379,7 +378,7 @@ const endMatch: STF<League, MatchRequest> = {
379378

380379
const [a, b] = Object.keys(teamScores);
381380
if (teamScores[a] === teamScores[b]) {
382-
throw new Error("MATCH_DRAWN");
381+
throw new Error("MATCH_NOT_CONCLUDED");
383382
}
384383

385384
const winner = teamScores[a] > teamScores[b] ? a : b;

0 commit comments

Comments
 (0)