Skip to content

Commit

Permalink
Try to simplify exception handling for threaded downloads again
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed Feb 1, 2021
1 parent 503d75b commit 90ee064
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions nf_core/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,16 +429,13 @@ def get_singularity_images(self):
for future in concurrent.futures.as_completed(future_downloads):
try:
future.result()
except Exception as e:
log.error(f"Download failed: {e}")
raise KeyboardInterrupt
else:
try:
progress.update(task, advance=1)
except Exception as e:
log.error(f"Error updating progress bar: {e}")

except KeyboardInterrupt:
except Exception as e:
log.error(f"Error downloading container: {e}")
# Cancel the future threads that haven't started yet
for future in future_downloads:
future.cancel()
Expand Down

0 comments on commit 90ee064

Please sign in to comment.