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

Python exception with incorrect command-line arguments #127

Closed
timcanham opened this issue Apr 19, 2023 · 0 comments · Fixed by #149
Closed

Python exception with incorrect command-line arguments #127

timcanham opened this issue Apr 19, 2023 · 0 comments · Fixed by #149
Assignees
Labels
bug Something isn't working

Comments

@timcanham
Copy link
Collaborator

timcanham commented Apr 19, 2023

F´ Version 3.x
Affected Component n/a

Problem Description

When an fprime-util command is executed with an incorrect argument, the Python code generates an unhelpful exception stack:

How to Reproduce

$: fprime-util generate -ut
Traceback (most recent call last):
  File "/xxxx/bin/fprime-util", line 8, in <module>
    sys.exit(main())
  File "/xxxx/lib/python3.8/site-packages/fprime/util/__main__.py", line 14, in main
    return fprime.util.build_helper.utility_entry(args=sys.argv[1:])
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 219, in utility_entry
    parsed, cmake_args, make_args, parser, runners = parse_args(args)
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 209, in parse_args
    cmake_args, make_args = validate(parsed, unknown)
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 115, in validate
    d_args = {
  File "/xxxx/lib/python3.8/site-packages/fprime/util/build_helper.py", line 116, in <dictcomp>
    match.group(1): match.group(2)
AttributeError: 'NoneType' object has no attribute 'group'

Expected Behavior

Should print an error like invalid argument "-ut"

@timcanham timcanham added the bug Something isn't working label Apr 19, 2023
@thomas-bc thomas-bc self-assigned this Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants