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 messaging #1

Open
2 tasks
kbuffardi opened this issue Sep 30, 2024 · 0 comments
Open
2 tasks

Improve error messaging #1

kbuffardi opened this issue Sep 30, 2024 · 0 comments

Comments

@kbuffardi
Copy link
Contributor

Currently, the program ignores values that don't meet the following criteria:

  • The value must be either 3 or 6 characters long (not in-between)
  • The value must be a hexadecimal digit (i.e. 0-9, and A-F, where letter values can be either upper or lower-case)

However, we want to give users specific error messages associated with the corresponding values, to see why values are excluded:

  • When a value's length is invalid, print to the console: ___ ERR_LENGTH: RGB values must be either 3 or 6 characters long where ___ is replaced with that particular value
  • When a value contains one or more characters that is not a hexademical digit, print to the console: ___ ERR_VALUE: RGB values must be in 0-F range where ___ is replaced with that particular value

In addition, if no values are provided (i.e. argc is below 2), then before the program quits, it should print to the console: ERR_MISSING: One or more RGB values should be provided as arguments, separated by spaces

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