cli: cleanup error handling
Metadata
Current evaluation
Merged CLI error handling cleanup. Removed legacy try/except block for Ubuntu 16.04 and switched to inline type hints to eliminate noqa comments. Approved by reviewer and passed CI checks.
Suggested action: —
No scores available.
Issue body
- Use inline typing (removing the need for noqa hints)
- Get rid of try/except clause considering 16.04 as we only care about
the snap now.
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged CLI error handling cleanup. Removed legacy try/except block for Ubuntu 16.04 and switched to inline type hints to eliminate noqa comments. Approved by reviewer and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged cleanup of CLI error handling. Replaced external type imports with inline annotations to eliminate noqa directives. Removed obsolete try/except blocks for Ubuntu 16.04, as legacy support is no longer required. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged cleanup of CLI error handling. Replaced legacy type imports with inline hints to remove noqa directives and dropped obsolete try/except blocks for Ubuntu 16.04, aligning the codebase with current snap-only support. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1436 cli: properly handle exceptions | snapcraft | merged | Merged a global exception handler for CLI errors, superseding PR #1429. Replaced per-command decorators to simplify maintenance and auto-coverage. Fixed exit_code property test failures before merge. | |
| #1495 cli: don't raise from excepthook | snapcraft | merged | Merged a fix to prevent raising exceptions in the CLI excepthook, which caused confusing Python error messages. The change manually prints tracebacks and exits cleanly. Approved by two reviewers and passed CI. | |
| #2521 cli: cleanup environment detection | snapcraft | merged | Merged cleanup of CLI environment detection. The pull request modified two files (+23/-21 lines), passed CI checks, and received approval. The refactoring was successfully integrated into the main branch despite a minor Codecov base commit warning. | |
| #1790 cli: include consistent commands to fix error conditions | snapcraft | merged | Merged implementation of consistent CLI commands to resolve error conditions. Closes #1733, depends on #1640, and received reviewer approval with minimal code changes across three files. |