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 for invalid arguments #2

Open
senofsky opened this issue Jul 16, 2020 · 1 comment
Open

Improve error messages for invalid arguments #2

senofsky opened this issue Jul 16, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@senofsky
Copy link
Owner

Currently, _validate_args() will log an error stating that a directory is not writeable if it does not exist.

While this is technically true, we should notify the users why the directory isn't writeable; notifying the user that the directory does not exist or the permissions are set to read-only is more helpful.

We should always strive to provide a positive user experience.

@senofsky senofsky added the enhancement New feature or request label Jul 16, 2020
@senofsky senofsky added the good first issue Good for newcomers label Jul 22, 2020
@senofsky
Copy link
Owner Author

Update: A couple of things have changed since this issue was created:

  • _validate_args no longer exists
  • command_line_interface.py interfaces with the user

However, we still need better exception handling logic in command_line_interface.py. For example:

image = cv2.imread(image_path)

doesn't check if the image path actually exists - this will result in a FileNotFoundError exception.

This is just one of many possible exceptions that need to be handled. The user should be informed that the image path they gave either does not exist, has permissions that prevents face-mask-detector from opening it, or has some other issue.

We need to catch every possible exception that can be raised and print a helpful error message to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants