Skip to content

[chore] Apply errhint.WithFix to remaining bare fmt.Errorf sites (follow-up to f8181b4) #172

@lugassawan

Description

@lugassawan

Type

  • Tests (coverage gaps, e2e, fixtures)

Files to change

  • cmd/exec.go
  • cmd/update.go
  • cmd/init.go
  • internal/operations/rename.go

Description

Commit f8181b4 applied errhint.WithFix consistently to user-facing errors across the codebase. Several sites were missed in that sweep and still use bare fmt.Errorf, leaving the user with no actionable recovery hint on failure.

Sites identified:

cmd/init.go — multiple bare fmt.Errorf calls for config-directory, gitignore, and legacy-config failures (lines 126, 137, 143, 148, 166, 172, 177, 184, 212, 232, 238) — each failure could include a "To fix: rimba init" or filesystem-specific hint.

cmd/update.go — update, download, binary-replace, and PATH errors (lines 44–121) — failures during self-update leave the binary in an unknown state; hints like "To fix: re-run rimba update" or "manually replace the binary at " would help.

cmd/exec.go — any error paths not yet covered.

internal/operations/rename.go:31,41 — "branch already exists" and "worktree moved but rename failed" — both benefit from a git branch -m or rimba rename recovery hint.

Acceptance

  • All fmt.Errorf calls in the listed files that produce user-visible errors are wrapped with errhint.WithFix(err, "To fix: <command>").
  • No regression in existing error-hint tests.
  • golangci-lint passes.

Bundles

Original candidate folded into this issue:

  • E5: follow-up sweep of fmt.Errorf sites not covered by f8181b4cmd/init.go, cmd/update.go, cmd/exec.go, internal/operations/rename.go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions