Improved exception message for failed imports
Signed-off-by: Matthias Koller <m.koller@peak-solution.de>
diff --git a/org.eclipse.mdm.apicopy/src/main/java/org/eclipse/mdm/apicopy/control/ImportTask.java b/org.eclipse.mdm.apicopy/src/main/java/org/eclipse/mdm/apicopy/control/ImportTask.java
index 2e81024..698518d 100644
--- a/org.eclipse.mdm.apicopy/src/main/java/org/eclipse/mdm/apicopy/control/ImportTask.java
+++ b/org.eclipse.mdm.apicopy/src/main/java/org/eclipse/mdm/apicopy/control/ImportTask.java
@@ -180,7 +180,7 @@
}
deleteFilesOfUploadedFileLinks();
- throw new ApiCopyException("Could not copy data.", exc);
+ throw new ApiCopyException("Could not copy data: " + exc.getMessage(), exc);
} finally {
classificationUtil.clearCache();
clearReplacedFileLinkCache();
@@ -869,7 +869,8 @@
.stream().filter(q -> q.getValue(Versionable.ATTR_VERSION_STATE).extract() == VersionState.VALID)
.sorted(Comparator.comparing(q -> Integer.valueOf(q.getValue(Versionable.ATTR_VERSION).extract())))
.findFirst().orElseThrow(() -> new ApiCopyException(String
- .format("Cannot find Quantity %s in destination!", channelSrc.getQuantity().getName())));
+ .format("Cannot find Quantity with name '%s' in destination!",
+ channelSrc.getQuantity().getName())));
Filter filter = Filter.nameOnly(etChannel, channelSrc.getName()).id(relMeasurement,
measurementParentDst.getID());