fix(ftp): ProbeFTP returns retrErr instead of err on RETR fallback failure #166

Merged
fuzzy merged 1 commit from feature/fix-ftp-136-134 into main 2026-07-15 17:29:06 +00:00
Owner

What

One-line fix: ProbeFTP returns retrErr (the actual RETR error) instead of err (the original SIZE error) when the RETR size-fallback fails.

Why

When GetFTPFileSize fails and the RETR fallback also fails, the function was returning the wrong error. A user debugging would see a SIZE error when RETR was the actual failure.

Also closes #134 (FTPS support) — already implemented via ParseFTPURL returning useTLS bool and DialFTP using ftp.DialWithTLS.

Testing

  • go test -race ./... — all pass
  • golangci-lint run — 0 issues

Breaking Changes

None

Closes #136, #134

## What One-line fix: ProbeFTP returns `retrErr` (the actual RETR error) instead of `err` (the original SIZE error) when the RETR size-fallback fails. ## Why When GetFTPFileSize fails and the RETR fallback also fails, the function was returning the wrong error. A user debugging would see a `SIZE` error when `RETR` was the actual failure. Also closes #134 (FTPS support) — already implemented via `ParseFTPURL` returning `useTLS bool` and `DialFTP` using `ftp.DialWithTLS`. ## Testing - [x] `go test -race ./...` — all pass - [x] `golangci-lint run` — 0 issues ## Breaking Changes None Closes #136, #134
fix(ftp): ProbeFTP returns retrErr instead of err on RETR fallback failure
All checks were successful
Test and Release / lint (pull_request) Successful in 2m53s
Test and Release / test (pull_request) Successful in 3m42s
b9497e378b
When GetFTPFileSize fails and the RETR fallback also fails, ProbeFTP
was returning the original SIZE error instead of the actual RETR error.
Also closes #134 (FTPS support) which was already implemented.

Closes #136, #134
the.auditor left a comment

Review: APPROVED

Verification

  • go vet ./... passes
  • go build ./... passes
  • go test -race ./... all pass

Fix

  • internal/downloader/ftp.go:186errretrErr so the actual RETR failure is reported when SIZE + RETR fallback both fail (fixes #136)
  • Closes #134 (FTPS support — already implemented)

Closes #134, #136 on merge.

## Review: APPROVED ### Verification - `go vet ./...` — ✅ passes - `go build ./...` — ✅ passes - `go test -race ./...` — ✅ all pass ### Fix - `internal/downloader/ftp.go:186` — `err` → `retrErr` so the actual RETR failure is reported when SIZE + RETR fallback both fail (fixes #136) - Closes #134 (FTPS support — already implemented) Closes #134, #136 on merge.
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-15 17:27:00 +00:00
fuzzy merged commit b9497e378b into main 2026-07-15 17:29:06 +00:00
fuzzy deleted branch feature/fix-ftp-136-134 2026-07-15 17:29:06 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/pget!166
No description provided.