-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patherrors.go
64 lines (49 loc) · 952 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package maclookup
import (
"fmt"
"time"
)
type HTTPClientError struct {
Err error
}
func (c *HTTPClientError) Error() string {
return c.Err.Error()
}
func (c *HTTPClientError) Unwrap() error {
return c.Err
}
type BadAPIRequest struct {
Err error
}
func (c *BadAPIRequest) Error() string {
return c.Err.Error()
}
func (c *BadAPIRequest) Unwrap() error {
return c.Err
}
type BadAPIKey struct {
Err error
}
func (c *BadAPIKey) Error() string {
return c.Err.Error()
}
func (c *BadAPIKey) Unwrap() error {
return c.Err
}
type RateLimitsExceeded struct {
Limit int64
Reset time.Time
Err error
}
func (c *RateLimitsExceeded) Error() string {
return fmt.Sprintf("rate limits exceded. current limit is %d. next reset %s", c.Limit, c.Reset.Format(time.RFC3339))
}
type BadAPIResponse struct {
Err error
}
func (c *BadAPIResponse) Error() string {
return c.Err.Error()
}
func (c *BadAPIResponse) Unwrap() error {
return c.Err
}