Skip to content

Commit

Permalink
handle exception when ena assembly report is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-ebi committed Feb 2, 2024
1 parent c631552 commit c0a851a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ public Optional<AssemblyEntity> getAssemblyByAccession(String accession) throws
public Optional<Path> downloadAssemblyReport(String accession) throws IOException {
ENABrowser enaBrowser = factory.build();
enaBrowser.connect();
Optional<Path> downloadPath;
try {
enaBrowser.connect();
downloadPath = downloadAssemblyReport(enaBrowser, accession);
} finally {
return downloadAssemblyReport(enaBrowser, accession);
} catch (Exception e){
logger.warn("Could not fetch Assembly Report from ENA for accession " + accession + "Exception: " + e);
return Optional.empty();
}finally {
try {
enaBrowser.disconnect();
} catch (IOException e) {
logger.warn("Error while trying to disconnect - ncbiBrowser (assembly: " + accession + ") : " + e);
}
}

return downloadPath;
}

@Retryable(value = Exception.class, maxAttempts = 5, backoff = @Backoff(delay = 2000, multiplier = 2))
Expand Down

0 comments on commit c0a851a

Please sign in to comment.