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,8 +57,18 @@ public class PrefillingMapper {
sourceValue = ((Map)sourceValue).get(sourceKey); sourceValue = ((Map)sourceValue).get(sourceKey);
} }
} }
try {
setValue(prefillingMapping, mapper.writeValueAsString(sourceValue), datasetWizardModel, parentNode, properties, type, licenseManager); 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()) { for (PrefillingFixedMapping fixedMapping: prefillingGet.getFixedMappings()) {
setValue(fixedMapping, fixedMapping.getValue(), datasetWizardModel, parentNode, properties, type, licenseManager); setValue(fixedMapping, fixedMapping.getValue(), datasetWizardModel, parentNode, properties, type, licenseManager);
} }