Catch exceptions raised when resolving plot directories (#13786)

* plotting: Catch exceptions raised when resolving plot directories

* `try/except/else` -> `try/except/continue`
This commit is contained in:
dustinface 2022-11-11 02:49:31 +01:00 committed by GitHub
parent 15111cf196
commit 978c3708aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,7 +78,11 @@ def get_plot_filenames(root_path: Path) -> Dict[Path, List[Path]]:
config = load_config(root_path, "config.yaml")
recursive_scan: bool = config["harvester"].get("recursive_plot_scan", False)
for directory_name in get_plot_directories(root_path, config):
try:
directory = Path(directory_name).resolve()
except (OSError, RuntimeError):
log.exception(f"Failed to resolve {directory_name}")
continue
all_files[directory] = get_filenames(directory, recursive_scan)
return all_files