canonical / canonical/craft-cli
ArgumentParsingError for command not found should hint at the command that raised it
Open
- Dominant language
- Python
- Stars
- 16
- Forks
- 27
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 12
Description
If the error class had an attribute with the command that raised it we could do more advanced error handling.
Right now I am looking into doing it this way:
```python
try:
cmd.run(...)
except ArgumentParsingError as err:
if err.__context__.args[0] not in dispatcher.commands.keys():
do_something()
else:
raise
```
Contributor guide
Assessment
This issue has not been assessed yet.