Skip to content

fix: report user errors once at the terminating boundary - #82

Merged
MaxandreOgeret merged 1 commit into
mainfrom
fix/critical-on-swallowed-paths
Jul 2, 2026
Merged

MaxandreOgeret merged 1 commit into
mainfrom
fix/critical-on-swallowed-paths

Conversation

@MaxandreOgeret

Copy link
Copy Markdown
Owner

Summary

ColliderUserError raise sites no longer log CRITICAL; the entrypoint reports the carried message once when the error actually terminates the command. Best-effort paths that swallow the error and continue (upgrade/remove/prune lock refresh checks, colliderfile scoping) no longer print CRITICAL lines on successful runs, while every failing path keeps a single, accurate message. Direct pkg prune on an unreadable lock now shows the cause without --verbose; remove --prune tolerates exactly the lock-skip (via a dedicated PruneLockUnreadableError) so real deletion failures still propagate honestly. Closes #79

Adversarially reviewed in two passes; both reviewer gates (order-dependent test, over-broad swallow in remove --prune) are fixed and pinned by tests.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines.
  • My commits follow Conventional Commits.
  • Tests pass (uv run pytest).
  • Format, lint, type, and static checks pass (uv run ruff format --check ., uv run ruff check ., uv run ty check collider, uv run pylint --rcfile=pyproject.toml ./collider).

AI disclosure (Tick all that apply)

  • AI tools were used for part or all of this change.
    • A human (not an AI agent) has reviewed every line, understands the change, and takes full responsibility for what is submitted.

ColliderUserError raise sites no longer log CRITICAL themselves; the
entrypoint logs the carried message once when the error terminates the
command. Callers that deliberately swallow the error and continue no
longer leave CRITICAL lines in the output of a successful command, and
propagating paths keep a single accurate message.

- from_path logs at debug so best-effort readers stay quiet; config
  load logs the message itself since SystemExit bypasses the entrypoint
  handler.
- Setup folds its two-line separator hint into the exception message.
- run_prune re-raises an unreadable lock as PruneLockUnreadableError
  after the skip summary, so direct prune fails with a visible cause
  while remove --prune tolerates exactly that skip (issue #46) without
  swallowing real deletion failures.
- The resolver scan raise site keeps a debug log so swallowed failures
  stay discoverable with --verbose.

Closes #79
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@MaxandreOgeret
MaxandreOgeret merged commit dd09bec into main Jul 2, 2026
18 checks passed
@MaxandreOgeret
MaxandreOgeret deleted the fix/critical-on-swallowed-paths branch July 2, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

file_model: from_path logs CRITICAL on paths callers deliberately swallow (CRITICAL + exit 0)

1 participant