Skip to content

Commit 7077e5a

Browse files
oschwaldclaude
andcommitted
Make MinFraudException a sealed class
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 488c546 commit 7077e5a

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/main/java/com/maxmind/minfraud/exception/InsufficientFundsException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This exception is thrown when your account does not have sufficient funds to complete the
55
* request.
66
*/
7-
public class InsufficientFundsException extends MinFraudException {
7+
public final class InsufficientFundsException extends MinFraudException {
88

99
/**
1010
* @param message A message explaining the cause of the error.

src/main/java/com/maxmind/minfraud/exception/InvalidRequestException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* occurs when the web service is up and responding to requests, but the request sent was invalid in
88
* some way.
99
*/
10-
public class InvalidRequestException extends MinFraudException {
10+
public final class InvalidRequestException extends MinFraudException {
1111
private final String code;
1212
private final int httpStatus;
1313
private final URI uri;

src/main/java/com/maxmind/minfraud/exception/MinFraudException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
* It also serves as the base class for {@code AuthenticationException},
88
* {@code InsufficientFundsException}, and {@code InvalidRequestException}.
99
*/
10-
public class MinFraudException extends Exception {
10+
public sealed class MinFraudException extends Exception
11+
permits AuthenticationException, InsufficientFundsException, InvalidRequestException,
12+
PermissionRequiredException {
1113

1214
/**
1315
* @param message A message explaining the cause of the error.

0 commit comments

Comments
 (0)