@@ -494,26 +494,29 @@ def setup_container_fetcher(self) -> None:
494494 Create the appropriate ContainerFetcher object
495495 """
496496 assert self .outdir is not None # mypy
497- if self .container_system == "singularity" :
498- self .container_fetcher = SingularityFetcher (
499- outdir = self .outdir ,
500- container_library = self .container_library ,
501- registry_set = self .registry_set ,
502- container_cache_utilisation = self .container_cache_utilisation ,
503- container_cache_index = self .container_cache_index ,
504- parallel = self .parallel ,
505- hide_progress = self .hide_progress ,
506- )
507- elif self .container_system == "docker" :
508- self .container_fetcher = DockerFetcher (
509- outdir = self .outdir ,
510- registry_set = self .registry_set ,
511- container_library = self .container_library ,
512- parallel = self .parallel ,
513- hide_progress = self .hide_progress ,
514- )
515- else :
516- self .container_fetcher = None
497+ try :
498+ if self .container_system == "singularity" :
499+ self .container_fetcher = SingularityFetcher (
500+ outdir = self .outdir ,
501+ container_library = self .container_library ,
502+ registry_set = self .registry_set ,
503+ container_cache_utilisation = self .container_cache_utilisation ,
504+ container_cache_index = self .container_cache_index ,
505+ parallel = self .parallel ,
506+ hide_progress = self .hide_progress ,
507+ )
508+ elif self .container_system == "docker" :
509+ self .container_fetcher = DockerFetcher (
510+ outdir = self .outdir ,
511+ registry_set = self .registry_set ,
512+ container_library = self .container_library ,
513+ parallel = self .parallel ,
514+ hide_progress = self .hide_progress ,
515+ )
516+ else :
517+ self .container_fetcher = None
518+ except OSError as e :
519+ raise DownloadError (e )
517520
518521 def prompt_use_singularity (self , fail_message : str ) -> None :
519522 use_singularity = questionary .confirm (
0 commit comments