[#25] Fix validation error
All checks were successful
DCO / DCO (pull_request) Successful in 47s
Verify code phase / Verify code (pull_request) Successful in 1m29s

Signed-off-by: Ori Bruk <o.bruk@yadro.com>
This commit is contained in:
Ori Bruk 2024-11-13 12:02:41 +03:00
parent 694bb963e4
commit 80c7ba58b2

View file

@ -16,10 +16,11 @@ import static java.util.Objects.isNull;
public class Validator {
public static <T> void validate(T object) {
StringBuilder errorMessage = new StringBuilder().append(System.lineSeparator());
StringBuilder errorMessage = new StringBuilder();
process(object, errorMessage);
if (errorMessage.length() != 0) {
errorMessage.insert(0, System.lineSeparator());
throw new ValidationFrostFSException(errorMessage.toString());
}
}