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

bad non-descriptive error message 'NoneType' object is not subscriptable #255

Open
alecGraves opened this issue Mar 26, 2023 · 1 comment · May be fixed by #256
Open

bad non-descriptive error message 'NoneType' object is not subscriptable #255

alecGraves opened this issue Mar 26, 2023 · 1 comment · May be fixed by #256

Comments

@alecGraves
Copy link

alecGraves commented Mar 26, 2023

This error message should be improved so it doesn't scare people, perhaps by describing exactly what data is set to None and maybe the line number of the input file.

Here is an example of a malformatted .repo file:

# example.repo
repositories:
  bad:
  ament_cmake:
    type: git
    url: https://github.com/ament/ament_cmake.git
    version: humble

And here is the resulting output of vcs:

$ vcs import --input example.repos src
Input data is not valid format: 'NoneType' object is not subscriptable
@christophebedard
Copy link
Contributor

christophebedard commented Mar 26, 2023

The parsing code already provides a useful error message when an attribute is missing (e.g., url:). However, as you showed above, it doesn't handle/detect empty repository entries. #256 fixes that.

Providing a line number is a bit more tricky, because, by that point, we're only dealing with dictionaries.

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

Successfully merging a pull request may close this issue.

2 participants