-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patherrors.go
62 lines (47 loc) · 1.36 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package configtypes
import (
"errors"
)
// Error is a type tag for all errors returned by this package.
type Error error
func errBoolFormat() Error {
return errors.New("not a valid boolean value (must be true/false, yes/no, or 0/1)")
}
func errDurationFormat() Error {
return errors.New(
`not a valid duration (must use format "1ms", "1s", "1m", etc.)`,
)
}
func errIntFormat() Error {
return errors.New("not a valid integer")
}
func errFloatFormat() Error {
return errors.New("not a valid number")
}
func errMustBeGreaterThanZero() Error {
return errors.New("value must be greater than zero")
}
func errMustBeNonEmptyString() Error {
return errors.New("value must not be an empty string")
}
func errMustBeNonNegative() Error {
return errors.New("value must not be negative")
}
func errRequired() Error {
return errors.New("value is required")
}
func errStringListJSONFormat() Error {
return errors.New("string list value must be a string, an array of strings, or null")
}
func errURLFormat() Error {
return errors.New("not a valid URL/URI")
}
func errBase2BytesFormat() Error {
return errors.New("not a valid base-2 byte size")
}
func errURLNotAbsolute() Error {
return errors.New("must be an absolute URL/URI")
}
func errValidateNonStruct() Error {
return errors.New("Validate was called with a parameter that was not a struct pointer") //nolint:stylecheck
}