-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.go
55 lines (44 loc) · 1.52 KB
/
error.go
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package feedgen
import (
"fmt"
)
// ItemFetchError shows that the item can't be fetched from the source URL.
type ItemFetchError struct {
SourceURL string
}
// Error returns error message
func (e ItemFetchError) Error() string {
return fmt.Sprintf("items can't be fetched from the source URL: %s", e.SourceURL)
}
// PageContentFetchError shows that the page content can't be fetched from the source URL.
type PageContentFetchError struct {
SourceURL string
}
// Error returns error message
func (e PageContentFetchError) Error() string {
return fmt.Sprintf("page content can't be fetched from the source URL: %s.", e.SourceURL)
}
// PageContentNotFoundError shows that the page content is not available from the source URL.
type PageContentNotFoundError struct {
SourceURL string
}
// Error returns error message
func (e PageContentNotFoundError) Error() string {
return fmt.Sprintf("page content is not found from the source URL: %s.", e.SourceURL)
}
// ParameterValueInvalidError shows that the query parameter Parameter's value is not available yet.
type ParameterValueInvalidError struct {
Parameter string
}
// Error returns error message
func (e ParameterValueInvalidError) Error() string {
return fmt.Sprintf("parameter %s has invalid value", e.Parameter)
}
// ParameterNotFoundError shows that the parameter Parameter is required.
type ParameterNotFoundError struct {
Parameter string
}
// Error returns error message
func (e ParameterNotFoundError) Error() string {
return fmt.Sprintf("parameter %s is required", e.Parameter)
}