- Avoid processing the assignments, for which the assignments_full-texts subdirectory cannot be created.

- Avoid a double-log.
This commit is contained in:
Lampros Smyrnaios 2023-05-31 02:27:24 +03:00
parent 7f3ca80959
commit 4a95826f58
1 changed files with 3 additions and 5 deletions

View File

@ -91,12 +91,10 @@ public class PublicationsRetrieverPlugin {
File curAssignmentsDirs = new File(FileUtils.storeDocFilesDir); File curAssignmentsDirs = new File(FileUtils.storeDocFilesDir);
try { try {
if ( !curAssignmentsDirs.mkdirs() ) // Create the subdirectory. if ( ! curAssignmentsDirs.mkdirs() ) // Create the subdirectory. It may return "false", in case it already exists (will not happen, unless there is problem in cleaning up of the subdirectories) or any problem occurred.
logger.error("Could not create the \"assignments_" + assignmentRequestCounter + "_fullTexts\" directories: \"" + FileUtils.storeDocFilesDir + "\"!"); throw new RuntimeException("Could not create the \"assignments_" + assignmentRequestCounter + "_fullTexts\" directories: \"" + FileUtils.storeDocFilesDir + "\"!");
} catch (Exception e) { // Mainly a SecurityException. } catch (Exception e) { // Mainly a SecurityException.
String errorMsg = "Failed to create the full-texts directory for assignments_" + assignmentRequestCounter; throw new RuntimeException("Failed to create the full-texts directory for assignments_" + assignmentRequestCounter + ": " + e.getMessage());
logger.error(errorMsg, e);
throw new RuntimeException(errorMsg + ": " + e.getMessage());
} }
// Start loading and checking urls. // Start loading and checking urls.