Files
aptly/http/http.go
André Roth f7057a9517 go1.24: fix lint, unit and system tests
- development env: base on debian trixie with go1.24
- lint: run with default config
- fix lint errors
- fix unit tests
- fix system test
2025-04-26 13:29:50 +02:00

29 lines
604 B
Go

// Package http provides all HTTP (and FTP)-related operations
package http
import (
"fmt"
"net/url"
)
// Error is download error connected to HTTP code
type Error struct {
Code int
URL string
}
// Error returns HTTP error message
func (e *Error) Error() string {
return fmt.Sprintf("HTTP code %d while fetching %s", e.Code, e.URL)
}
// NoCandidateFoundError indicates that now candidate of given url could be found
type NoCandidateFoundError struct {
URL *url.URL
}
// Error message
func (e *NoCandidateFoundError) Error() string {
return fmt.Sprintf("no candidates for %s found", e.URL)
}