meta: add error check for "command not found"
Metadata
Current evaluation
Merged. Adds error handling for missing app commands by replacing PrimedCommandNotFoundError with InvalidAppCommandNotFound and includes unit tests. Approved and merged after brief discussion on exception handling.
Suggested action: —
No scores available.
Issue body
When not allowing massaged comamnds (e.g. core20), app commands
not found were triggering InvalidAppCommandNotExecutable() errors.
- Add check for presence of app command, throwing
InvalidAppCommandNotFound.
- Remove errors.PrimedCommandNotFoundError, replacing
usage with InvalidAppCommandNotFound for consistency.
- Add unit tests for both of these cases.
Signed-off-by: Chris Patterson <chris.patterson@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. Adds error handling for missing app commands by replacing PrimedCommandNotFoundError with InvalidAppCommandNotFound and includes unit tests. Approved and merged after brief discussion on exception handling. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Introduces a check for missing app commands, replacing PrimedCommandNotFoundError with InvalidAppCommandNotFound for consistency. Includes unit tests. Finalized after brief discussion on exception handling and app_name context. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added validation for missing app commands, replacing PrimedCommandNotFoundError with InvalidAppCommandNotFound for consistency. Includes unit tests and implements exception handling discussed in code review. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2539 errors: Add InvalidAppCommand errors for non-existent and not-found | snapcraft | merged | Added InvalidAppCommand error classes for non-existent and not-found command apps. Approved by reviewers, passed CI and coverage checks, and merged following the release window reopening. | |
| #2272 meta: friendlier message for incorrect app command | snapcraft | merged | Merged changes that provide friendlier error messages for missing application commands and warn when commands are not relative to the prime directory. Approved by one reviewer, passed CI, and modified four files. |