fix: improve ~40 terse error messages with actionable guidance#80
Open
fix: improve ~40 terse error messages with actionable guidance#80
Conversation
Make returned errors self-contained and actionable — include the failing value where applicable and suggest the remediation command. Users see the returned error (shown by Cobra) last, so it needs to be helpful on its own without the preceding output.Error() context. Changes across 10 files: - "not authenticated" → includes "run td auth login" - "not linked" → includes "run td sync-project link <id>" - "invalid selection" → includes valid range - "no projects found" → suggests creation command - "no active work session" → suggests "td ws start <name>" - "work session already active" → includes session name, suggests "td ws end" - "issue ID required" → suggests "td list" - "no issues specified" → suggests providing IDs or --all - "title is required" → suggests argument or --title flag - "invalid points" → includes the invalid value - "no previous data to restore" → clearer "cannot undo" phrasing - Sentinel errors (ErrUnauthorized, ErrForbidden, ErrNotFound) → descriptive Nightshift-Task: error-msg-improve Nightshift-Ref: https://github.com/marcus/nightshift Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fmt.Errorf()return values across 10 files in the CLI layersyncclient(ErrUnauthorized,ErrForbidden,ErrNotFound) now include descriptive contextFiles changed
cmd/project.go— 7x "not authenticated", 4x "not linked", 1x "no projects found", 1x "invalid selection"cmd/sync.go— 1x "not authenticated", 1x "not linked"cmd/sync_init.go— 1x "not authenticated", 1x "project name required", 1x "no projects found", 1x "invalid selection"cmd/create.go— 1x "title is required", 1x "invalid points"cmd/ws.go— 1x "work session already active", 5x "no active work session"cmd/show.go— 2x "issue ID required"cmd/review.go— 1x "no issues specified", 1x "no issue specified"cmd/autosync.go— 1x "unauthorized"cmd/undo.go— 3x "no previous data to restore"internal/syncclient/client.go— 3x sentinel error descriptionsTest plan
go buildcompiles successfullygo test ./cmd/...passes (existing tests usestrings.Containsfor substring matching)go test ./internal/syncclient/...— no test files (sentinel errors tested viaerrors.Iselsewhere)🤖 Generated with Claude Code
Automated by nightshift