← Back to issue list

snapcraft has many exit points

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1477639
Type
issue
State
closed
Author
~elopio
Labels
—
Created
Updated
Closed

Current evaluation

Partially addressed in September 2015 by commit 922a96d2f, which removed several internal exit points, but the broader refactor remained unfinished.

Resolution: closed resolved

Reason: Sergiusens reported removing several exit points in commit 922a96d2f. The issue was then closed after that concrete cleanup, although no fully completed centralized exception-handling refactor was identified.

Evaluated by: mr-cal-bot

No scores available.

Issue body

I think it should be better to raise exceptions on many of these cases that exit with 1. Then, the main method can catch the exceptions, and exit with 1. For the cases that exit with 0, we should just return to the main caller. elopio@calchas:~/workspace/canonical/snapcraft/trunk$ grep -r sys.exit snapcraft/cmds.py: sys.exit(1) snapcraft/cmds.py: sys.exit(0) snapcraft/cmds.py: sys.exit(1) snapcraft/cmds.py: sys.exit(1) snapcraft/cmds.py: sys.exit(1) snapcraft/plugins/ant_project.py: sys.exit(1) snapcraft/plugins/ubuntu.py: sys.exit(1) snapcraft/plugins/ubuntu.py: sys.exit(1) snapcraft/main.py: sys.exit(1) snapcraft/main.py: sys.exit(0) snapcraft/yaml.py: sys.exit(1) snapcraft/yaml.py: sys.exit(1) snapcraft/yaml.py: sys.exit(1) snapcraft/plugin.py: sys.exit(1) snapcraft/common.py: sys.exit(1)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Partially addressed in September 2015 by commit 922a96d2f, which removed several internal exit points, but the broader refactor remained unfinished.
stealth/space-bunny-alpha — closed resolved Partially resolved in 2015 as internal exits were replaced with exceptions or returns; the issue was closed with an offer to reopen if further cleanup was needed.
stealth/space-bunny-alpha — closed stale Abandoned after years of inactivity; the proposed sys.exit-to-exception cleanup was never completed, and no fixing PR or commit was identified.
qwen/qwen3.6-35b-a3b — — Abandoned. The proposal to replace scattered sys.exit() calls with centralized exception handling was not implemented. The codebase evolved independently without adopting this refactoring.
qwen/qwen3.6-35b-a3b — — Abandoned. The suggestion to centralize error handling via exceptions instead of scattered sys.exit() calls was not adopted, leaving the codebase unchanged.
qwen/qwen3.6-35b-a3b — — Closed and abandoned with no comments. The proposal to replace scattered sys.exit calls with exceptions and return statements was not implemented. Subsequent refactoring likely addressed the architecture independently.
qwen3.6-35b-a3b-mtp-q6 — — The suggestion to replace scattered sys.exit calls with centralized exception handling was closed without resolution. The proposal was abandoned or addressed by subsequent codebase refactoring.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#92 (confidence 70%)

    The maintainer comment dated 2015-09-21 says several exits were removed; commit 922a96d2f is the likely corresponding cleanup.

Related issues

Issue Project State Summary Similarity
#1662658 snapcraft namespace is getting crowded with store methods snapcraft (launchpad) closed Closed as expired on 2017-04-16 after 60 days of inactivity; no namespace migration PR or commit was recorded on the issue.
70%