diff --git a/src/ingest_validation_tests/fastq_validator_logic.py b/src/ingest_validation_tests/fastq_validator_logic.py index 440ceb4..2c87c91 100644 --- a/src/ingest_validation_tests/fastq_validator_logic.py +++ b/src/ingest_validation_tests/fastq_validator_logic.py @@ -167,6 +167,10 @@ def validate_fastq_file(self, fastq_file: Path) -> None: except IOError: self.errors.append(self._format_error(f"Unable to open FASTQ data file {fastq_file}.")) return + except EOFError: + self.errors.append(self._format_error(f"EOF in FASTQ data file {fastq_file}.")) + except Exception as e: + self.errors.append(self._format_error(f"Unexpected error: {e} on data file {fastq_file}.")) self._file_record_counts[str(fastq_file)] = records_read def validate_fastq_files_in_path(self, paths: List[Path], threads: int) -> None: @@ -192,6 +196,9 @@ def validate_fastq_files_in_path(self, paths: List[Path], threads: int) -> None: data_output = pool.imap_unordered(engine, file_list) except Exception as e: _log(f"Error {e}") + pool.close() + pool.join() + data_found_one.append(f"Error {e}") else: pool.close() pool.join() diff --git a/src/ingest_validation_tests/gz_validator.py b/src/ingest_validation_tests/gz_validator.py index 9bb0162..fe0a147 100644 --- a/src/ingest_validation_tests/gz_validator.py +++ b/src/ingest_validation_tests/gz_validator.py @@ -46,6 +46,9 @@ def collect_errors(self, **kwargs) -> List[str]: data_output = pool.imap_unordered(engine, file_list) except Exception as e: _log(f"Error {e}") + pool.close() + pool.join() + data_output2.extend(f"Error: {e}") else: pool.close() pool.join()