Skip to content

Commit

Permalink
gracefully exit in case of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Jan 8, 2024
1 parent f44c3f2 commit 81477ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dicom_unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import csv
from pflog import pflog
from pftag import pftag
__version__ = '1.1.2'
__version__ = '1.1.4'

DISPLAY_TITLE = r"""
_ _ _ _
Expand Down Expand Up @@ -72,7 +72,11 @@ def main(options: Namespace, inputdir: Path, outputdir: Path):
#
# Refer to the documentation for more options, examples, and advanced uses e.g.
# adding a progress bar and parallelism.
mapper = PathMapper.file_mapper(inputdir, outputdir, glob=f"**/*.{options.fileFilter}")
try:
mapper = PathMapper.file_mapper(inputdir, outputdir, glob=f"**/*.{options.fileFilter}")
except Exception as ex:
print(ex)
sys.exit()
for input_file, output_file in mapper:
dicom_file = read_dicom(str(input_file))
if dicom_file is None:
Expand Down

0 comments on commit 81477ec

Please sign in to comment.