meta: add error check for "command not found"
Metadata
Current evaluation
Merged in snapcraft#3321 via commit 44930f709: missing app commands now raise InvalidAppCommandNotFound; PrimedCommandNotFoundError was removed and unit tests added.
Resolution: closed resolved
Reason: The approved pull request was merged as commit 44930f709, adding the missing-command check, replacing the old error, and covering both cases with unit tests.
Evaluated by: mr-cal-bot
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in snapcraft#3321 via commit 44930f709: missing app commands now raise InvalidAppCommandNotFound; PrimedCommandNotFoundError was removed and unit tests added. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #3321 via commit 44930f709: missing app commands now raise InvalidAppCommandNotFound; PrimedCommandNotFoundError was replaced and unit tests added. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #3321 via commit 44930f709, adding explicit missing app-command validation and replacing PrimedCommandNotFoundError with InvalidAppCommandNotFound. | |
| stealth/space-bunny-alpha | — | closed resolved | PR #3321 merged via commit 44930f709: missing app commands now raise InvalidAppCommandNotFound, replacing errors.PrimedCommandNotFoundError, plus unit tests for both cases. | |
| stealth/space-bunny-alpha | — | closed resolved | PR #3321 by cjp256 merged to snapcraft master as commit 44930f709: app commands absent from the primed dir now raise InvalidAppCommandNotFound instead of InvalidAppCommandNotExecutable; PrimedCommandNotFoundError removed, unit tests added. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #3321 via commit 44930f709: missing app commands now raise InvalidAppCommandNotFound, replacing PrimedCommandNotFoundError, with unit tests. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3321 in commit 44930f709: added missing app-command checks, replaced PrimedCommandNotFoundError with InvalidAppCommandNotFound, and added unit tests. | |
| 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. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1791175 check for the existence of a command | snapcraft (launchpad) | closed | Missing app-command validation received a clearer error in merged PR snapcraft#2272, committed as 65ba888da. | |
| #2272 meta: friendlier message for incorrect app command | snapcraft | merged | Merged in canonical/snapcraft#2272 (65ba888da), adding a clearer missing app-command error and a warning for commands not relative to the prime directory. | |
| #2539 errors: Add InvalidAppCommand errors for non-existent and not-found | snapcraft | merged | Merged PR #2539 via commit e0cb7cb94, adding InvalidAppCommand errors for missing and non-executable app commands. | |
| #1727425 same error for app command not existent and not executable | snapcraft (launchpad) | closed | Fixed by PR #2539 in commit e0cb7cb94, adding distinct InvalidAppCommand errors for non-existent and non-executable commands. | |
| #2048898 No helpfull message when command doesn't exist | snapcraft (launchpad) | open | Snapcraft gave only a generic pack failure when an app command was absent from the staged snap; commit 44930f709 and PR #3321 later added command-not-found validation. |