sources: introduce SnapcraftSourceNotFoundError
Metadata
Current evaluation
Merged PR #2604 introduced clearer missing-source errors via SnapcraftSourceNotFoundError, exception chaining, and tests in commit 7527d0e82.
Resolution: closed resolved
Reason: PR #2604 was approved and merged as commit 7527d0e82. It added the new exception, chained shutil.copy2 FileNotFoundError context, and included tests.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Many of the errors seen by users indicate source not found.
- introduce SnapcraftSourceNotFoundError with helpful error
message
- chain to FileNotFoundError raised by shutil.copy2(), a common
cause of the captured FileNotFoundError exceptions
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 PR #2604 introduced clearer missing-source errors via SnapcraftSourceNotFoundError, exception chaining, and tests in commit 7527d0e82. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2604 introduced SnapcraftSourceNotFoundError for clearer missing-source errors, chained it to FileNotFoundError from shutil.copy2, and added tests in commit 7527d0e82. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Introduces SnapcraftSourceNotFoundError to improve error messaging for missing sources, chaining to FileNotFoundError. Adds unit tests, fixes formatting, and resolves internal tickets SNAPCRAFT-VV, VN, TJ, T9, and TE. Approved and CI-passed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Introduces SnapcraftSourceNotFoundError to improve error messaging for missing source files. Adds unit tests, simplifies related logic, and resolves multiple SNAPCRAFT tracking issues. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1794272 Errors when pulling sources result in traceback | snapcraft (launchpad) | closed | Source-pull failures now produce clear errors instead of tracebacks and Sentry reports, fixed by canonical/snapcraft#2292 in commit 1bb56d427. | |
| #21 snapcraft throws FileExistsError: with very simple Python snap | snapcraft | closed | Replaced the FileExistsError with local-source validation in 0e575ce53; corrected local-source handling merged via PR #377 (8b4a18d9b). | |
| #1649569 Make plugin/source error reporting a bit more useful | snapcraft (launchpad) | closed | Merged PR snapcore/snapcraft#958 added the source value to invalid-handler errors, making “no handler to manage source” identify the unrecognized source. | |
| #1600428 Setting source: .. causes pull to fail | snapcraft (launchpad) | closed | Fixed by snapcore/snapcraft#725, adding support for snapcraft.yaml in a subdirectory and preventing recursive source copying. | |
| #1499424 snapcraft throws FileExistsError: with very simple Python snap | snapcraft (launchpad) | closed | Snapcraft 0.4 fixed the misleading FileExistsError for local file sources, now reporting that the source is not a directory; change 0e575ce53. |