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

BUG: error messages while importing subcommand modules are suppressed #87

Open
shilorigins opened this issue Sep 26, 2024 · 1 comment

Comments

@shilorigins
Copy link
Collaborator

Current Behavior

If an error occurs while loading a subcommand module (e.g. bin/ui.py), the specific error message is suppressed and the program exits with a generic invalid choice message.

Expected Behavior

Errors that occur while loading subcommand modules should be shown to the user, at least when that subcommand is used.

Context / environment

During development, the obfuscation of error messages forces me to run through a debugger to reproduce the error message or to carefully inspect the file changes.

Steps to Reproduce (for bugs)

  1. In the global namespace of bin/ui.py, add a line raise Exception("Reason for the error")
  2. Run superscore ui
  3. Note the output: 'ui' is not a valid choice, but no reason is given

Suggested Solution

@tangkong
Copy link
Contributor

This is due to how we gather the sub-commands. If the subcommand throws an exception while being prepared, it's simply not prepared nor made available.

I've recently worked out a better way to build the argparser, which should speed things up and will probably also propagate errors fully. It just hasn't made its way here yet

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

2 participants