File: http.go

package info (click to toggle)
aptly 1.4.0%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 48,064 kB
  • sloc: python: 7,045; sh: 790; makefile: 77
file content (28 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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
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)
}