Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need graceful error for directories #12

Open
spficklin opened this issue May 29, 2024 · 0 comments
Open

Need graceful error for directories #12

spficklin opened this issue May 29, 2024 · 0 comments
Milestone

Comments

@spficklin
Copy link
Member

spficklin commented May 29, 2024

When I accidentally provided a path that was not a directory I got the following error:

granny -i cli -d /local/projects/granny/demo/cross_section_images/cross_section_tray/cross_section_demo_image.jpeg -a segmentation
Traceback (most recent call last):
  File "/home/ficklin/.local/bin/granny", line 8, in <module>
    sys.exit(run())
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/GrannyBase.py", line 31, in run
    GrannyCLI(parser).run()
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Interfaces/UI/GrannyCLI.py", line 101, in run
    images = self.listImages(self.image_dir)
  File "/home/ficklin/.local/lib/python3.10/site-packages/Granny/Interfaces/UI/GrannyCLI.py", line 61, in listImages
    image_files: List[str] = os.listdir(image_dir)
NotADirectoryError: [Errno 20] Not a directory: '/local/projects/granny/demo/cross_section_images/cross_section_tray/cross_section_demo_image.jpeg'

We need a more graceful error message to report to the user

@spficklin spficklin added this to the Version 1.0 milestone May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant