Document intentional error suppressions with comments (gt-zn9m)
All 156 instances of _ = error suppression in non-test code now have explanatory comments documenting why the error is intentionally ignored. Categories of intentional suppressions: - non-fatal: session works without these - tmux environment setup - non-fatal: theming failure does not affect operation - visual styling - best-effort cleanup - defer cleanup on failure paths - best-effort notification - mail/notifications that should not block - best-effort interrupt - graceful shutdown attempts - crypto/rand.Read only fails on broken system - random ID generation - output errors non-actionable - fmt.Fprint to io.Writer This addresses the silent failure and debugging concerns raised in the issue by making the intentionality explicit in the code. Generated with Claude Code https://claude.com/claude-code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,8 +36,8 @@ func (m *Manager) CreateIntegrationBranch(swarmID string) error {
|
||||
return fmt.Errorf("creating branch: %w", err)
|
||||
}
|
||||
|
||||
// Push to origin
|
||||
_ = m.gitRun("push", "-u", "origin", branchName) // Non-fatal - may not have remote
|
||||
// Push to origin (non-fatal: may not have remote)
|
||||
_ = m.gitRun("push", "-u", "origin", branchName)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -61,8 +61,8 @@ func (m *Manager) MergeToIntegration(swarmID, workerBranch string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch the worker branch
|
||||
_ = m.gitRun("fetch", "origin", workerBranch) // May not exist on remote, try local
|
||||
// Fetch the worker branch (non-fatal: may not exist on remote, try local)
|
||||
_ = m.gitRun("fetch", "origin", workerBranch)
|
||||
|
||||
// Attempt merge
|
||||
err = m.gitRun("merge", "--no-ff", "-m",
|
||||
@@ -97,8 +97,8 @@ func (m *Manager) LandToMain(swarmID string) error {
|
||||
return fmt.Errorf("checking out %s: %w", swarm.TargetBranch, err)
|
||||
}
|
||||
|
||||
// Pull latest
|
||||
_ = m.gitRun("pull", "origin", swarm.TargetBranch) // Ignore errors
|
||||
// Pull latest (non-fatal: may fail if remote unreachable)
|
||||
_ = m.gitRun("pull", "origin", swarm.TargetBranch)
|
||||
|
||||
// Merge integration branch
|
||||
err := m.gitRun("merge", "--no-ff", "-m",
|
||||
@@ -133,10 +133,10 @@ func (m *Manager) CleanupBranches(swarmID string) error {
|
||||
lastErr = err
|
||||
}
|
||||
|
||||
// Delete integration branch remotely
|
||||
_ = m.gitRun("push", "origin", "--delete", swarm.Integration) // Ignore errors
|
||||
// Delete integration branch remotely (best-effort cleanup)
|
||||
_ = m.gitRun("push", "origin", "--delete", swarm.Integration)
|
||||
|
||||
// Delete worker branches
|
||||
// Delete worker branches (best-effort cleanup)
|
||||
for _, task := range swarm.Tasks {
|
||||
if task.Branch != "" {
|
||||
// Local delete
|
||||
|
||||
@@ -210,7 +210,7 @@ Manual intervention required.`,
|
||||
swarmID, strings.Join(workers, "\n- ")),
|
||||
Priority: mail.PriorityHigh,
|
||||
}
|
||||
_ = router.Send(msg)
|
||||
_ = router.Send(msg) // best-effort notification
|
||||
}
|
||||
|
||||
// notifyMayorLanded sends a landing report to Mayor.
|
||||
@@ -233,5 +233,5 @@ Tasks merged: %d`,
|
||||
result.BranchesCleaned,
|
||||
len(swarm.Tasks)),
|
||||
}
|
||||
_ = router.Send(msg)
|
||||
_ = router.Send(msg) // best-effort notification
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user