From 46c92252e4c19f26f8d91ec38110df3c72a63f9a Mon Sep 17 00:00:00 2001 From: "M. C. DeMarco" Date: Tue, 30 Dec 2025 20:54:15 -0500 Subject: [PATCH] Note current function when throwing errors --- src/games/frogger.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/games/frogger.ts b/src/games/frogger.ts index c1c361af..16770596 100644 --- a/src/games/frogger.ts +++ b/src/games/frogger.ts @@ -335,7 +335,7 @@ export class FroggerGame extends GameBase { //The advanced case is handled inside this function, unlike in getNextForward. const cardObj = Card.deserialize(card); if (cardObj === undefined) { - throw new Error(`Could not deserialize the card ${card}`); + throw new Error(`Could not deserialize the card ${card} in checkNextForward.`); } if (this.variants.includes("advanced") && cardObj.rank.uid !== this.courtrank) { @@ -473,7 +473,7 @@ export class FroggerGame extends GameBase { private getSuits(cardId: string): string[] { const card = Card.deserialize(cardId); if (card === undefined) { - throw new Error(`Could not deserialize the card ${cardId}`); + throw new Error(`Could not deserialize the card ${cardId} in getSuits.`); } const suits = card.suits.map(s => s.uid); return suits; @@ -568,7 +568,7 @@ export class FroggerGame extends GameBase { //Bouncing occurs when an Ace or Crown was played, not a number card or a Court. const card = Card.deserialize(cardId); if (card === undefined) { - throw new Error(`Could not deserialize the card ${cardId}`); + throw new Error(`Could not deserialize the card ${cardId} in moveNeighbors`); } const rank = card.rank.name; @@ -864,7 +864,7 @@ export class FroggerGame extends GameBase { let to; const cardObj = Card.deserialize(card); if (cardObj === undefined) { - throw new Error(`Could not deserialize the card ${card}`); + throw new Error(`Could not deserialize the card ${card} in randomMove.`); } if (this.variants.includes("advanced") && cardObj.rank.uid !== this.courtrank) { @@ -1656,7 +1656,7 @@ export class FroggerGame extends GameBase { const card = this.board.get(cell)!; const cardObj = Card.deserialize(card); if (cardObj === undefined) { - throw new Error(`Could not deserialize the card ${card}`); + throw new Error(`Could not deserialize the card ${card} in render.`); } const suits = cardObj!.suits;