Skip to content

Commit 2bcbda9

Browse files
committed
fix(annotations): replace RuntimeException with ValidationException in SiftMatchValidator
1 parent e14faf0 commit 2bcbda9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sift-annotations/src/main/java/com/mirkoddd/sift/annotations/SiftMatchValidator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import jakarta.validation.ConstraintValidator;
1919
import jakarta.validation.ConstraintValidatorContext;
20+
import jakarta.validation.ValidationException;
21+
2022
import java.util.regex.Pattern;
2123

2224
/**
@@ -45,7 +47,7 @@ public void initialize(SiftMatch constraintAnnotation) {
4547

4648
this.compiledPattern = Pattern.compile(rawRegex, combinedFlags);
4749
} catch (Exception e) {
48-
throw new RuntimeException("Failed to initialize SiftRegexProvider: " + constraintAnnotation.value().getName() + ". Ensure it has a public no-args constructor.", e);
50+
throw new ValidationException("Failed to initialize SiftRegexProvider: " + constraintAnnotation.value().getName() + ". Ensure it has a public no-args constructor.", e);
4951
}
5052
}
5153

0 commit comments

Comments
 (0)