Skip to content

Commit

Permalink
Improve error message when uploading a mef zip file containing lots o…
Browse files Browse the repository at this point in the history
…f records. Identify the uuid of the record that failed to load. (geonetwork#4838)
  • Loading branch information
ianwallen authored Aug 7, 2020
1 parent 3068983 commit c6be00b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/src/main/java/org/fao/geonet/kernel/mef/Importer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6be00b

Please sign in to comment.