Skip to content

Commit 92027a9

Browse files
committed
Extend error message in 3-get-card-value.js
1 parent 023e69f commit 92027a9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ function getCardValue(card) {
3535
}
3636

3737
if (!(suit === "♠" || suit === "♥" || suit === "♦" || suit === "♣")) {
38-
throw new Error("Invalid suit ", suit);
38+
throw new Error(
39+
"Invalid second character detected, only suits(♠♥♦♣) are allowed, but got this character:",
40+
suit
41+
);
3942
}
4043

4144
if (rank == "A") {

0 commit comments

Comments
 (0)