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 message if label omitted #123

Open
MarcelRobitaille opened this issue Mar 22, 2022 · 0 comments
Open

Improve error message if label omitted #123

MarcelRobitaille opened this issue Mar 22, 2022 · 0 comments

Comments

@MarcelRobitaille
Copy link

The error message when the --label flag is forgotten is cryptic. It is not easy to see what went wrong, or even if it was a bug or your own fault.

Here is what I get:

Traceback (most recent call last):
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/bin/brother_ql", line 8, in <module>
    sys.exit(cli())
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/brother_ql/cli.py", line 146, in print_cmd
    instructions = convert(qlr=qlr, **kwargs)
  File "/home/marcel/code/quin/CNT_Automation/barcoding/venv/lib/python3.10/site-packages/brother_ql/conversion.py", line 48, in convert
    label_specs = label_type_specs[label]
KeyError: None

I would expect something like:

The flag `--label` is required

My command:

venv/bin/brother_ql --printer usb://0x04f9:0x2043 --model QL-710W print  /tmp/qr.png

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