JohnnyIrvin/shell-craft

ValueError returned when no API key is found

Closed this issue · 0 comments

Translate ValueError to argparse error

Describe the bug
Currently, when no API key is found, a ValueError is returned instead of a more appropriate argparse error.

To Reproduce

  1. Run the program without specifying an API key.
  2. Observe that a ValueError is raised.

Expected behavior
When no API key is provided, the program should raise an argparse error that indicates the user must provide an API key.

Additional context
This bug may cause confusion for users if they are not familiar with the Python ValueError exception. It is also not the most helpful error message in this context, as it does not clearly indicate what went wrong or how to fix it. Replacing the ValueError with an argparse error will improve the clarity of error messages and make it easier for users to understand and fix this issue.