Skip to content

Commit

Permalink
improve error message if reader nott available (#3457)
Browse files Browse the repository at this point in the history
improve error message if reader nott available
  • Loading branch information
rijobro authored Dec 8, 2021
1 parent 29e9ab3 commit a7bc4a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion monai/transforms/io/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ def __call__(self, filename: Union[Sequence[PathLike], PathLike], reader: Option
break

if img is None or reader is None:
if isinstance(filename, tuple) and len(filename) == 1:
filename = filename[0]
raise RuntimeError(
f"can not find a suitable reader for file: {filename}.\n"
f"cannot find a suitable reader for file: {filename}.\n"
" Please install the reader libraries, see also the installation instructions:\n"
" https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies.\n"
f" The current registered: {self.readers}.\n"
Expand Down

0 comments on commit a7bc4a3

Please sign in to comment.