-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
48 lines (41 loc) · 1.07 KB
/
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
package zeit
const ErrorOrigin = "zeit API does not use `@` to represent the origin, use empty string instead"
const ErrorNilRecord = "pointer to record is nil"
type BasicError struct {
Code string `json:"code"`
Message string `json:"message"`
}
func (e BasicError) Error() string {
return e.Message
}
type ConflictError struct {
BasicError
OldId string `json:"oldId"`
OldIds []string `json:"oldIds"`
}
type GetError struct {
BasicError
Name string `json:"name"`
}
type VerificationError struct {
BasicError
Name string `json:"name"`
NsVerification struct {
Name string `json:"name"`
Nameservers []string `json:"nameservers"`
IntendedNameservers []string `json:"intendedNameservers"`
} `json:"nsVerification"`
TxtVerification struct {
Name string `json:"name"`
Values []string `json:"values"`
VerificationRecord string `json:"verificationRecord"`
} `json:"txtVerification"`
}
type RateLimitError struct {
BasicError
Limit struct {
Total int
Remaining int
Reset int64
}
}