feat: improve error messages with structured errors and suggestions#340
Open
aronchick wants to merge 1 commit intodlorenc:mainfrom
Open
feat: improve error messages with structured errors and suggestions#340aronchick wants to merge 1 commit intodlorenc:mainfrom
aronchick wants to merge 1 commit intodlorenc:mainfrom
Conversation
P0 Roadmap item: Clear error messages This change ensures every user-facing error tells users: 1. What went wrong (clear, categorized message) 2. How to fix it (actionable suggestion) Changes: - Add 17 new error constructors to internal/errors for common failure modes - Update ~50 error handling locations in CLI to use structured errors - Replace raw fmt.Errorf calls with CLIError providing suggestions New error types added: - RepoAlreadyExists, DirectoryAlreadyExists, WorkspaceAlreadyExists - InvalidWorkspaceName, InvalidTmuxSessionName - LogFileNotFound, InvalidDuration, NoDefaultRepo - StateLoadFailed, SessionIDGenerationFailed, PromptWriteFailed - ClaudeStartFailed, AgentRegistrationFailed - WorktreeCleanupNeeded, TmuxWindowCleanupNeeded, TmuxSessionCleanupNeeded - WorkerNotFound, AgentNoSessionID Before: Error: failed to register worker: connection refused After: Error: failed to register worker with daemon: connection refused Try: multiclaude daemon status Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor Author
| ✅ Merge Queue: READY TO MERGE
This PR is ready for maintainer merge. |
whitmo added a commit to whitmo/multiclaude that referenced this pull request Feb 28, 2026
whitmo added a commit to whitmo/multiclaude that referenced this pull request Feb 28, 2026
…nc#336, dlorenc#340, dlorenc#342 Add 659 lines of tests covering: - All 18 structured error constructors from PR dlorenc#340 (individual + bulk format test) - JSON CLI output edge cases from PR dlorenc#335 (empty/nested/all-internal subcommands) - Structured CLIError validation for workspace names from PR dlorenc#340 integration - Message routing edge cases from PR dlorenc#342 (no acked, mixed ack status) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 28, 2026
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
Review of structured error constructors PR from upstream dlorenc/multiclaude. Identified duplicate constructor definitions with different signatures, minor category inconsistencies, and verbose string wrapping patterns. All critical issues already resolved in merge commit a03d3ea. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
…nc#336, dlorenc#340, dlorenc#342 Add 659 lines of tests covering: - All 18 structured error constructors from PR dlorenc#340 (individual + bulk format test) - JSON CLI output edge cases from PR dlorenc#335 (empty/nested/all-internal subcommands) - Structured CLIError validation for workspace names from PR dlorenc#340 integration - Message routing edge cases from PR dlorenc#342 (no acked, mixed ack status) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 1, 2026
3 tasks
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
P0 Roadmap item: Clear error messages - Ensure every failure tells the user what went wrong and how to fix it.
internal/errorsfor common failure modesfmt.Errorfcalls withCLIErrorthat provides actionable guidanceBefore/After Examples
Before:
After:
Before:
After:
New Error Types
RepoAlreadyExistsmulticlaude repo rmDirectoryAlreadyExistsWorkspaceAlreadyExistsmulticlaude workspace listInvalidWorkspaceNameLogFileNotFoundInvalidDurationNoDefaultRepo--repoorrepo useStateLoadFailedmulticlaude repairSessionIDGenerationFailedPromptWriteFailedClaudeStartFailedAgentRegistrationFailedmulticlaude daemon statusWorktreeCleanupNeededgit worktree removeTmuxWindowCleanupNeededtmux kill-windowTmuxSessionCleanupNeededtmux kill-sessionWorkerNotFoundmulticlaude worker listAgentNoSessionIDTest plan
go test ./internal/...)go test ./pkg/...)go build ./cmd/multiclaude)🤖 Generated with Claude Code