fixed catching of exception in deleteFileSetRoutine

This commit is contained in:
Francesco Mangiacrapa 2023-04-28 16:53:30 +02:00
parent 8b92ee395b
commit a210d1e237
1 changed files with 6 additions and 5 deletions

View File

@ -1266,12 +1266,13 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
// Changed by Francesco
RegisteredFileSet fs = null;
error = null;
Exception theExc = null;
Exception filesetExc = null;
try {
List<Object> deleteList = wrapper.getByPath(path);
if (deleteList == null || deleteList.isEmpty()) {
error = "List of object going to delete is null or empty";
log.info(error);
log.warn(error);
filesetExc = new ConfigurationException(error);
}
if (error == null) {
@ -1282,8 +1283,8 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
} catch (Exception e) {
error = "Error on getting the RegisteredFileSet for path: " + path;
log.warn(error);
filesetExc = e;
log.debug("Error is: ", e);
theExc = e;
}
if (error != null) {
@ -1291,8 +1292,8 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
log.info("ignore_errors is {}, returning input doc {}", ignore_errors, doc.getId());
return doc;
}
log.info("Thrown "+ConfigurationException.class.getSimpleName()+" with message {}", theExc.getMessage());
throw new ConfigurationException(theExc.getMessage());
log.info("Thrown "+ConfigurationException.class.getSimpleName()+" with message {}", filesetExc.getMessage());
throw new ConfigurationException(filesetExc.getMessage());
}