diff --git a/CHANGELOG.md b/CHANGELOG.md index 4462890..143d875 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Version 0.9.1 -* Fixed a bug that occured when parsing some plasmid FASTA record IDs. +* Fixed a bug that occured when parsing some plasmid FASTA record IDs ([PR 159](https://github.com/phac-nml/staramr/pull/159)). +* Fixed issue where sometimes the extraction of error messages from `makeblastdb` was crashing leading to less useful errors ([PR 160](https://github.com/phac-nml/staramr/pull/160)). # Version 0.9.0 diff --git a/staramr/blast/JobHandler.py b/staramr/blast/JobHandler.py index 0091506..ccd8efe 100644 --- a/staramr/blast/JobHandler.py +++ b/staramr/blast/JobHandler.py @@ -286,5 +286,7 @@ def _make_blast_db(self, path: str, file: str) -> None: subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True) except subprocess.CalledProcessError as e: err_msg = str(e.stderr.strip()) - err_msg = re.findall('REF\|(.*?)\'', err_msg)[0] + err_msg_match = re.findall('REF\|(.*?)\'', err_msg) + if len(err_msg_match) > 0: + err_msg = err_msg_match[0] raise Exception('Could not run makeblastdb on file {}, error {}'.format(file, err_msg))