Skip to content

Commit 305683d

Browse files
authored
Do not retry query for OS errors (#84)
1 parent 964fb7a commit 305683d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

genomicsdb/scripts/genomicsdb_query.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,15 @@ def process(config):
675675
logging.info(f"Processed {msg}")
676676
# exit out of the loop as the query has completed
677677
return 0
678+
except OSError as e:
679+
# See https://docs.python.org/3/library/exceptions.html#OSError, possible errors are :
680+
# File not found: Attempting to open a file that does not exist
681+
# Permission denied: Trying to access a file or directory without the necessary permissions.
682+
# Disk full: Running out of storage space while writing to a file.
683+
# Invalid file path: Providing an incorrect or malformed file path.
684+
# Device errors: Problems with hardware devices, such as a disconnected drive.
685+
logging.critical(f"Cannot continue - OS Error encountered while processing {msg} : {e}")
686+
raise e
678687
except Exception as e:
679688
# Try to handle read errors with expired access tokens for azure urls
680689
# e.g. GenomicsDBIteratorException exception : Error while reading from TileDB array

0 commit comments

Comments
 (0)