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:
@@ -277,24 +277,24 @@ func (g *Git) CheckConflicts(source, target string) ([]string, error) {
|
||||
// Check if there are unmerged files (indicates conflict)
|
||||
conflicts, err := g.getConflictingFiles()
|
||||
if err == nil && len(conflicts) > 0 {
|
||||
// Abort the test merge
|
||||
// Abort the test merge (best-effort cleanup)
|
||||
_ = g.AbortMerge()
|
||||
return conflicts, nil
|
||||
}
|
||||
|
||||
// Check if it's a conflict error from wrapper
|
||||
if errors.Is(mergeErr, ErrMergeConflict) {
|
||||
_ = g.AbortMerge()
|
||||
_ = g.AbortMerge() // best-effort cleanup
|
||||
return conflicts, nil
|
||||
}
|
||||
|
||||
// Some other merge error
|
||||
// Some other merge error (best-effort cleanup)
|
||||
_ = g.AbortMerge()
|
||||
return nil, mergeErr
|
||||
}
|
||||
|
||||
// Merge succeeded (no conflicts) - abort the test merge
|
||||
// Use reset since --abort won't work on successful merge
|
||||
// Use reset since --abort won't work on successful merge (best-effort cleanup)
|
||||
_, _ = g.run("reset", "--hard", "HEAD")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user