-
Notifications
You must be signed in to change notification settings - Fork 0
fix: document or handle intentionally ignored errors #47
Copy link
Copy link
Closed
Description
Summary
11 instances of silently swallowed errors with _ = or missing checks.
Current State
Examples:
internal/gmail/client.go:96-_ = keychain.MigrateFromFile(tokPath)internal/keychain/keychain.go:105-defer f.Close()without error checkinternal/cmd/config/config.go:113-116- Errors ignored in conditionalinternal/gmail/client.go:129-defer func() { _ = f.Close() }()internal/zip/extract.go:151-_ = fs.Remove(destPath)
Problems
- Unclear if errors are intentionally ignored or accidentally missed
- Future maintainers may not understand the intent
- Could mask real issues
Proposed Solution
For each instance, either:
- Add comment explaining why error is intentionally ignored:
// Migration failure is non-fatal - token may not exist
_ = keychain.MigrateFromFile(tokPath)- Log the error at debug level (after logging is added):
if err := keychain.MigrateFromFile(tokPath); err != nil {
log.Debug("migration skipped", "error", err)
}- Handle the error properly if it matters
Priority
P3 - Code clarity
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels