[#25] Fix validation error #26

Merged
pogpp merged 1 commit from orikik/frostfs-sdk-java:bugfix/validation-error into master 2024-11-13 09:06:24 +00:00

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());
}
}