Applied validation for few fields in call

This commit is contained in:
nisha
2024-10-01 18:05:35 +05:30
parent f6de2a012e
commit 7bde0e91e7
4 changed files with 30 additions and 5 deletions

View File

@@ -66,7 +66,9 @@ public class DateTimeUtil {
public static LocalTime parseTime(String timeString) throws DateTimeParseException {
DateTimeFormatter formatter;
if(timeString==null) {
return null;
}
if (!TIME_PATTERN.matcher(timeString).matches()) {
throw new CustomValidationException(Status.BAD_REQUEST,"Invalid time format: " + timeString);
}