1
0
Fork 0

[gtr2 plugin] changed to try not to die if one publication link point to the website of the project

This commit is contained in:
Miriam Baglioni 2024-12-10 16:26:24 +01:00
parent 69dad7e2bf
commit 19a9bddab1
2 changed files with 7 additions and 1 deletions

View File

@ -160,7 +160,7 @@ public class ORCIDExtractor extends Thread {
}
} finally {
for (SequenceFile.Writer k : fileMap.values()) {
log.info("Thread {}: Completed processed {} items", id, extractedItem);
log.info("Thread {}: Completed processed {} items", id, extractedItem);
k.hflush();
k.close();
}

View File

@ -152,6 +152,12 @@ public class Gtr2PublicationsIterator implements Iterator<String> {
} catch (final Throwable e) {
log.error("Error dowloading url: {}, attempt = {}", cleanUrl, attempt, e);
if(attempt == -1)
try{
DocumentHelper.parseText("<empty></empty>");
}catch(Throwable t){
throw new RuntimeException();
}
if (attempt >= MAX_ATTEMPTS) {
throw new RuntimeException("Error downloading url: " + cleanUrl, e);
}