Skip to content

fix(errors): improve "not found" error messages#774

Merged
max-sixty merged 1 commit intomainfrom
cannot-find
Jan 21, 2026
Merged

fix(errors): improve "not found" error messages#774
max-sixty merged 1 commit intomainfrom
cannot-find

Conversation

@max-sixty
Copy link
Owner

Summary

  • Consolidate NoWorktreeFound and InvalidReference into clearer error types
  • Add ReferenceNotFound for commit-ish validation (--base accepts tags/commits)
  • Improve message phrasing to be more natural:
    • BranchNotFound: "No branch named X"
    • ReferenceNotFound: "No branch, tag, or commit named X"
    • WorktreeNotFound: "Branch X has no worktree"
  • Context-aware hints: suppress "create branch" hint for wt remove operations

Test plan

  • All 911 integration tests pass
  • All 430 unit tests pass
  • Snapshots updated and reviewed

🤖 Generated with Claude Code

- Rename NoWorktreeFound → BranchNotFound (consolidate with InvalidReference)
- Add ReferenceNotFound for commit-ish validation (--base accepts tags/commits)
- Improve message phrasing:
  - BranchNotFound: "No branch named X"
  - ReferenceNotFound: "No branch, tag, or commit named X"
  - WorktreeNotFound: "Branch X has no worktree"
- Add show_create_hint field to BranchNotFound to suppress "create" hint
  for remove operations where it doesn't make sense

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 85c4fc1 into main Jan 21, 2026
19 checks passed
@max-sixty max-sixty deleted the cannot-find branch January 21, 2026 03:40
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.

1 participant