From c6be00b5947d39a986b1118c2d83655c30e0152a Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 7 Aug 2020 09:36:06 -0300 Subject: [PATCH] Improve error message when uploading a mef zip file containing lots of records. Identify the uuid of the record that failed to load. (#4838) --- .../java/org/fao/geonet/kernel/mef/Importer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/fao/geonet/kernel/mef/Importer.java b/core/src/main/java/org/fao/geonet/kernel/mef/Importer.java index fb423d88a1c..d16629a99bc 100644 --- a/core/src/main/java/org/fao/geonet/kernel/mef/Importer.java +++ b/core/src/main/java/org/fao/geonet/kernel/mef/Importer.java @@ -397,10 +397,14 @@ public void handleInfo(Element info, int index) throws Exception { } - importRecord(uuid, uuidAction, md, schema, index, - source, sourceName, sourceTranslations, - context, metadataIdMap, createDate, - changeDate, groupId, isTemplate); + try { + importRecord(uuid, uuidAction, md, schema, index, + source, sourceName, sourceTranslations, + context, metadataIdMap, createDate, + changeDate, groupId, isTemplate); + } catch (Exception e) { + throw new Exception("Failed to import metadata with uuid '" + uuid + "'. " + e.getLocalizedMessage(), e); + } if (fc.size() != 0 && fc.get(index) != null) { // UUID is set as @uuid in root element