Skip to content

Commit

Permalink
improve error message about century number for EE/LV id number generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Solntsev authored and asolntsev committed Jan 27, 2025
1 parent 8a1758a commit 2899094
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int firstDigit(int birthYear, Gender gender) {
case 19 -> 3;
case 20 -> 5;
case 21 -> 7;
default -> throw new IllegalStateException("Too far in future: " + birthYear);
default -> throw new IllegalStateException("Birth year %s is out of allowed range [1800, 2199]".formatted(birthYear));
};
return switch (gender) {
case FEMALE -> digit + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/datafaker/idnumbers/LatvianIdNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int centuryDigit(int birthYear) {
case 18 -> 0;
case 19 -> 1;
case 20 -> 2;
default -> throw new IllegalStateException("Too far in future: " + birthYear);
default -> throw new IllegalStateException("Birth year %s is out of allowed range [1800, 2017]".formatted(birthYear));
};
}

Expand Down

0 comments on commit 2899094

Please sign in to comment.