log errors from validateHostingAssets via logError( () -> ...) instead of try catch

This commit is contained in:
Michael Hoennig 2024-08-09 15:19:19 +02:00
parent 22f493be73
commit 6b112df592

View File

@ -652,14 +652,12 @@ public class ImportHostingAssets extends ImportOfficeData {
void validateHostingAssets(final Map<Integer, HsHostingAssetRealEntity> assets) {
assets.forEach((id, ha) -> {
try {
logError(() ->
new HostingAssetEntitySaveProcessor(em, ha)
.preprocessEntity()
.validateEntity()
.prepareForSave();
} catch (final Exception exc) {
errors.add("validation failed for id:" + id + "( " + ha + "): " + exc.getMessage());
}
.prepareForSave()
);
});
}