Skip to content

Fix reversed errors.Is() argument order in CLI uploader - #425

Merged
Forceu merged 2 commits into
Forceu:masterfrom
bauerpawel:fix/cli-errors-is-order
Sep 12, 2026
Merged

Forceu merged 2 commits into
Forceu:masterfrom
bauerpawel:fix/cli-errors-is-order

Conversation

@bauerpawel

Copy link
Copy Markdown
Contributor

Description

errors.Is(err, target) expects the error being checked first and the sentinel second; several calls in the CLI uploader (cmd/cli-uploader/Main.go, cmd/cli-uploader/cliconfig/cliconfig.go) had them swapped. Harmless today since none of the sentinels are themselves wrapped (so the initial equality check still matches either way), but fixed for correctness and to avoid silently breaking if a sentinel ever gets wrapped.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Technical Details

  • Database changes: No
  • Storage backend affected: No
  • Usage of AI: Yes — developed with Claude Code as a pair-programming assistant (spotted while reviewing the CLI error-handling code, applied the fix). I reviewed and tested all changes before submitting.

How Has This Been Tested?

  • Unit Tests: go test ./... --tags=test,awsmock (full suite passes; cmd/cli-uploader has no test files, this is a straightforward argument-order correction with no behavior change under current conditions)
  • Environment: Windows 11

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas. (n/a — no new logic, argument-order fix only)
  • I have made corresponding changes to the documentation. (n/a — no behavior change)
  • My changes generate no new warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d

bauerpawel and others added 2 commits September 9, 2026 14:49
errors.Is(err, target) expects the error being checked first and the
sentinel second; these 6 calls had them swapped. Harmless today since
none of the sentinels are themselves wrapped (so the initial equality
check still matches either way), but fix for correctness and to avoid
silently breaking if a sentinel ever gets wrapped.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019woTYJGrS4pfPWC6CCgffQ
Same bug as cliconfig.go: errors.Is(err, target) expects the error
being checked first and the sentinel second; these calls had them
swapped. Harmless today since the sentinel isn't itself wrapped, but
fixed for correctness.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d
@Forceu
Forceu merged commit d903337 into Forceu:master Sep 12, 2026
@Forceu

Forceu commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants