catch error in prefilling when source mapping does not exist in the api's response

This commit is contained in:
Bernaldo Mihasi 2023-07-20 13:00:24 +03:00
parent e878310b72
commit 2db9ea613f
1 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,17 @@ public class PrefillingMapper {
sourceValue = ((Map)sourceValue).get(sourceKey);
}
}
setValue(prefillingMapping, mapper.writeValueAsString(sourceValue), datasetWizardModel, parentNode, properties, type, licenseManager);
try {
setValue(prefillingMapping, mapper.writeValueAsString(sourceValue), datasetWizardModel, parentNode, properties, type, licenseManager);
}
catch (Exception e) {
if (prefillingMapping.getSemanticTarget() != null && !prefillingMapping.getSemanticTarget().isEmpty()) {
logger.warn("Couldn't map " + prefillingMapping.getSemanticTarget());
}
else if (prefillingMapping.getTarget() != null && !prefillingMapping.getTarget().isEmpty()) {
logger.warn("Couldn't map " + prefillingMapping.getTarget());
}
}
}
for (PrefillingFixedMapping fixedMapping: prefillingGet.getFixedMappings()) {
setValue(fixedMapping, fixedMapping.getValue(), datasetWizardModel, parentNode, properties, type, licenseManager);