diff --git a/src/main/java/uk/ac/ebi/eva/contigalias/datasource/ENAAssemblyDataSource.java b/src/main/java/uk/ac/ebi/eva/contigalias/datasource/ENAAssemblyDataSource.java index b4c01557..5423a505 100644 --- a/src/main/java/uk/ac/ebi/eva/contigalias/datasource/ENAAssemblyDataSource.java +++ b/src/main/java/uk/ac/ebi/eva/contigalias/datasource/ENAAssemblyDataSource.java @@ -102,19 +102,19 @@ public Optional getAssemblyByAccession(String accession) throws public Optional downloadAssemblyReport(String accession) throws IOException { ENABrowser enaBrowser = factory.build(); enaBrowser.connect(); - Optional 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))