mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
- development env: base on debian trixie with go1.24 - lint: run with default config - fix lint errors - fix unit tests - fix system test
29 lines
604 B
Go
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)
|
|
}
|