Subcategory: Error handling & API UX (+ linting)
Score: error handling 7 → 10
Both sites are deliberate best-effort degradations that log a warning and continue — the intent is right. The problem is that except Exception also swallows genuine bugs (typos, attribute errors) in the same block, turning them into a silent warning.
What to change
src/pycharting/api/interface.py:252 — around webbrowser.open(chart_url); narrow to webbrowser.Error (add OSError if needed)
src/pycharting/core/server.py:141 — around app.mount(... StaticFiles ...); narrow to OSError / RuntimeError
done when
ruff reports no BLE001 and both handlers name specific exception types while keeping the existing warn-and-continue behaviour.
Evidence
BLE001 Do not catch blind exception: `Exception`
--> src/pycharting/api/interface.py:252:20
Surfaced by the Rhiza quality gates during the template bump to jebel-quant/rhiza@v1.2.2, which enabled the stricter ruff rule families (ANN, A, BLE, ARG) and TYPECHECKER=both. Gate status at time of filing: make fmt FAIL, make typecheck FAIL, make docs-coverage FAIL, test-layout FAIL; make deptry, make security, make test PASS (154 tests, 100% coverage).
Subcategory: Error handling & API UX (+ linting)
Score: error handling 7 → 10
Both sites are deliberate best-effort degradations that log a warning and continue — the intent is right. The problem is that
except Exceptionalso swallows genuine bugs (typos, attribute errors) in the same block, turning them into a silent warning.What to change
src/pycharting/api/interface.py:252— aroundwebbrowser.open(chart_url); narrow towebbrowser.Error(addOSErrorif needed)src/pycharting/core/server.py:141— aroundapp.mount(... StaticFiles ...); narrow toOSError/RuntimeErrordone when
ruffreports no BLE001 and both handlers name specific exception types while keeping the existing warn-and-continue behaviour.Evidence
Surfaced by the Rhiza quality gates during the template bump to
jebel-quant/rhiza@v1.2.2, which enabled the stricter ruff rule families (ANN, A, BLE, ARG) andTYPECHECKER=both. Gate status at time of filing:make fmtFAIL,make typecheckFAIL,make docs-coverageFAIL, test-layout FAIL;make deptry,make security,make testPASS (154 tests, 100% coverage).