[Code quality] Stop swallowing exceptions: 341 `try/except/pass` and 751 blind `except Exception` in app/
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the Ruff configuration in pyproject.toml and the exception handling in app/core/mover.py, app/core/history.py, and the undo and rollback paths. Run ruff check app --select S110,BLE001,SIM105 to inspect the current findings, then add the rules with a baseline and work through one area at a time. Done means CI enforces all three rules, the baseline only shrinks, and the mover, undo, rollback, and history paths contain no swallowed exceptions.
Written by the indexing model from the issue text.
Description
Problem
ruff check app --select S110,BLE001,SIM105 on main (2026-10-19):
| Rule | Count | Meaning |
|---|---|---|
S110 try-except-pass |
341 | the failure is discarded with no log |
BLE001 blind-except |
751 | except Exception / bare except |
SIM105 suppressible-exception |
158 | try/except/pass that should be contextlib.suppress(SpecificError) |
Most S110 hits are in app/ui/tui.py (86), app/core/history.py (28), analyzer_strategies.py (22), user_space_bootstrap.py (21), daemon.py (17), db.py (15), extractor_strategies.py (15), mover.py (14), main.py (13) and db_conn.py (11). Several of these sit on move, undo and rollback paths. There, a swallowed error means a file operation silently didn't happen, and the next bug report has no trace to follow.
Proposed approach
- Ratchet first. Enable
S110,BLE001andSIM105in[tool.ruff.lint]with the existing hits listed in a baseline. One way is per-file ignores, generated once and shrunk over time. New code can't add more, and nothing gets rewritten in bulk. - Fix by risk, one area per PR. Start with mover, undo, rollback and history, then the DB layer, then the daemon, then the UI. For each block, do one of the following:
- catch the specific exception the call can raise;
- log it at
debugorwarningwith context, if continuing is correct; - let it propagate, if the caller can handle it;
- use
contextlib.suppress(SpecificError)for intentional best-effort cleanup.
- Remove each file from the baseline once it's clean.
Acceptance criteria
S110,BLE001andSIM105are enforced in CI, with a baseline that only shrinks.- No
except ...: passremains on the mover, undo, rollback or history paths.
Tracked as item 10 in the 2026-10-19 tech-debt register.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- Avg merge
- 10h 10m
- Merged PRs (30d)
- 420
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fderuiter/sortify
-
bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 57/100
Maintainers usually reply within 1 day
-
enhancement ready-for-human
Difficulty 4/5 3-5 days Newbie friendliness 48/100
fderuiter/sortify#740 · 1 comment ·
Maintainers usually reply within 1 day
-
architecture enhancement ready-for-human
Difficulty 5/5 Over a week Newbie friendliness 25/100
fderuiter/sortify#726 · 1 comment ·
Maintainers usually reply within 1 day
-
architecture enhancement ready-for-human
Difficulty 5/5 Over a week Newbie friendliness 25/100
fderuiter/sortify#723 · 1 comment ·
Maintainers usually reply within 1 day
All issues in fderuiter/sortify
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
[Bug]: Queen's own Ollama model loses num_ctx when a running session switches to itPossibly taken @anasamin26 claimed this today. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aden-hive/hive#7508 · 1 comment ·
Maintainers usually reply within 1 day
-
llm translation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BerriAI/litellm#47884 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug 🐛
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
netalertx/NetAlertX#1856 · 1 reaction ·
Maintainers usually reply within 1 day