-
Notifications
You must be signed in to change notification settings - Fork 3
/
errors.go
49 lines (38 loc) · 929 Bytes
/
errors.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
package installer
import (
"fmt"
"net/http"
)
type UnsupportGameErr struct {
Game string
}
func (e *UnsupportGameErr) Error() string {
return fmt.Sprintf("Unsupport game type %q", e.Game)
}
type NotLocalPathErr struct {
Path string
}
func (e *NotLocalPathErr) Error() string {
return fmt.Sprintf("%q is not a local path", e.Path)
}
type HashErr struct {
Hash string
Sum string
Expect string
}
func (e *HashErr) Error() string {
return fmt.Sprintf("Unexpect %s hash %s, expect %s", e.Hash, e.Sum, e.Expect)
}
type HttpStatusError struct {
Code int
}
func (e *HttpStatusError) Error() string {
return fmt.Sprintf("Unexpect http status %d %s", e.Code, http.StatusText(e.Code))
}
type ContentLengthNotMatchErr struct {
ContentLength int64
Expect int64
}
func (e *ContentLengthNotMatchErr) Error() string {
return fmt.Sprintf("Unexpect content length %d, expect %d", e.ContentLength, e.Expect)
}