Skip to content

Commit

Permalink
Merge pull request #20 from bioio-devs/fix/improve-error-string
Browse files Browse the repository at this point in the history
improve error string
  • Loading branch information
toloudis authored Nov 3, 2023
2 parents 8214901 + e07db9e commit 4b3040b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bioio/bio_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ def determine_reader(
No reader could be found that supports the provided image.
"""
# Try reader detection based off of file path extension
image_str = str(type(image))
if isinstance(image, (str, Path)):
image_str = str(image)
_, path = biob.io.pathlike_to_fs(
image, enforce_exists=True, fs_kwargs=fs_kwargs
)
Expand All @@ -167,10 +169,9 @@ def determine_reader(

# If we haven't hit anything yet, we likely don't support this file / object
# with the current plugins installed
image_type = str(type(image))
raise biob.exceptions.UnsupportedFileFormatError(
"BioImage",
image_type,
image_str,
msg_extra=(
"You may need to install an extra format dependency. "
"See bioio README for list of some known plugins."
Expand Down

0 comments on commit 4b3040b

Please sign in to comment.