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

improve error messages: distinguish permission from file-not-found #1506

Open
rmsppu opened this issue Oct 31, 2022 · 0 comments
Open

improve error messages: distinguish permission from file-not-found #1506

rmsppu opened this issue Oct 31, 2022 · 0 comments

Comments

@rmsppu
Copy link

rmsppu commented Oct 31, 2022

Describe the bug
When an unreadable input file is specified, the error message returned could be more helpful. The error message is that that the file wasn't found, which is true in the sense that the contents of the parent directory are unreadable, but "file not found" can be distinguished from "some component in the path has permissions that prevents reading the file (if it even exists)".

To Reproduce

  1. Confirm that a valid DICOM exists but is unreadable due to permissions:
/path/to/an/unreadable/file/DET0001_03.dcm: DICOM medical imaging data
$ ls -l /path/to/an/unreadable/file/DET0001_03.dcm
ls: cannot access /path/to/an/unreadable/file/DET0001_03.dcm: Permission denied
  1. Run CaPTk, specifying the unreadable file as input:
    BreastTexturePipeline -i /path/to/an/unreadable/file/DET0001_03.dcm -o unc_test/ -d 1
    Starting pre-processing.
    [getFilenameExtension()] Supplied file name '/path/to/an/unreadable/file/DET0001_03.dcm' wasn't found.


**Preferred behavior**
The error message should distinguish various cases, such as:

- File not found (ie., the directory path was valid and readable, but the specified file doesn't exist).
- File not found due to directory permissions (ie., permissions on a directory component prohibit checking if the file exists or not)
- File not readable due to permissions (ie., the permissions on the directory path allow stat(filename), but the content is unreadable due to permissions)

**CaPTk Version**
Linux, 1.9.0
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