Skip to content

Commit

Permalink
Merge pull request #60 from hubmapconsortium/phillips/tiff_validator_…
Browse files Browse the repository at this point in the history
…bugfix

Catching tiff exceptions more robustly
  • Loading branch information
gesinaphillips authored Jul 29, 2024
2 parents a997805 + 77f22af commit 2691964
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/ingest_validation_tests/tiff_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ def collect_errors(self, **kwargs) -> List[Optional[str]]:
for path in self.paths:
for file in path.glob(glob_expr):
filenames_to_test.append(file)
rslt_list: List[Optional[str]] = list(
rslt
for rslt in pool.imap_unordered(_check_tiff_file, filenames_to_test)
if rslt is not None
)
try:
rslt_list: List[Optional[str]] = list(
rslt
for rslt in pool.imap_unordered(_check_tiff_file, filenames_to_test)
if rslt is not None
)
except Exception as e:
_log(f"Error {e}")
rslt_list = [f"Error {e}"]
pool.close()
pool.join()
if rslt_list:
return rslt_list
elif filenames_to_test:
Expand Down

0 comments on commit 2691964

Please sign in to comment.