You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was running the tool I accidentally provided a file to it that did not exist (fat finger typo). The tool gave me a confusing UnboundLocalError message that might be confusing for users not familiar with reading Python tracebacks. Suggestion for the tool to exit gracefully if a non-existent file is supplied by providing a more clear error message.
Currently:
(ternenv) rose@rose-vm:~/ternenv/ntia-conformance-checker/ntia_conformance_checker$ python3 main.py -v --file dne.spdx
ERROR:root:Filename dne.spdx not found.
ERROR:root:Document cannot be parsed: [Errno 2] No such file or directory: 'dne.spdx'
Traceback (most recent call last):
File "/home/rose/ternenv/ntia-conformance-checker/ntia_conformance_checker/main.py", line 51, in <module>
main() # pylint: disable=no-value-for-parameter
File "/home/rose/ternenv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/rose/ternenv/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/rose/ternenv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/rose/ternenv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/rose/ternenv/ntia-conformance-checker/ntia_conformance_checker/main.py", line 36, in main
sbom = sbom_checker.SbomChecker(file)
File "/home/rose/ternenv/ntia-conformance-checker/ntia_conformance_checker/sbom_checker.py", line 17, in __init__
self.doc = self.parse_file()
File "/home/rose/ternenv/ntia-conformance-checker/ntia_conformance_checker/sbom_checker.py", line 42, in parse_file
return doc
UnboundLocalError: local variable 'doc' referenced before assignment
When I was running the tool I accidentally provided a file to it that did not exist (fat finger typo). The tool gave me a confusing
UnboundLocalError
message that might be confusing for users not familiar with reading Python tracebacks. Suggestion for the tool to exit gracefully if a non-existent file is supplied by providing a more clear error message.Currently:
Could be improved to something like:
The text was updated successfully, but these errors were encountered: