-
-
Notifications
You must be signed in to change notification settings - Fork 262
Expand file tree
/
Copy patherrors.go
More file actions
executable file
·92 lines (74 loc) · 2.5 KB
/
errors.go
File metadata and controls
executable file
·92 lines (74 loc) · 2.5 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package carbon
import (
"fmt"
)
var (
// ErrFailedParse failed to parse error.
ErrFailedParse = func(value any) error {
return fmt.Errorf("failed to parse %v as carbon", value)
}
// ErrFailedScan failed to scan error.
ErrFailedScan = func(value any) error {
return fmt.Errorf("failed to scan %v as carbon", value)
}
// ErrInvalidTimestamp invalid timestamp error.
ErrInvalidTimestamp = func(value string) error {
return fmt.Errorf("invalid timestamp %v", value)
}
// ErrNilLocation nil location error.
ErrNilLocation = func() error {
return fmt.Errorf("location cannot be nil")
}
// ErrNilLanguage nil language error.
ErrNilLanguage = func() error {
return fmt.Errorf("language cannot be nil")
}
// ErrInvalidLanguage invalid language error.
ErrInvalidLanguage = func(lang *Language) error {
return fmt.Errorf("invalid Language %v", lang)
}
// ErrEmptyLocale empty locale error.
ErrEmptyLocale = func() error {
return fmt.Errorf("locale cannot be empty")
}
// ErrNotExistLocale not exist locale error.
ErrNotExistLocale = func(locale string) error {
return fmt.Errorf("locale %q doesn't exist", locale)
}
// ErrEmptyResources empty resources error.
ErrEmptyResources = func() error {
return fmt.Errorf("resources cannot be empty")
}
// ErrEmptyTimezone empty timezone error.
ErrEmptyTimezone = func() error {
return fmt.Errorf("timezone cannot be empty")
}
// ErrInvalidTimezone invalid timezone error.
ErrInvalidTimezone = func(timezone string) error {
return fmt.Errorf("invalid timezone %q, please see the file %q for all valid timezones", timezone, "$GOROOT/lib/time/zoneinfo.zip")
}
// ErrEmptyDuration empty duration error.
ErrEmptyDuration = func() error {
return fmt.Errorf("duration cannot be empty")
}
// ErrInvalidDuration invalid duration error.
ErrInvalidDuration = func(duration string) error {
return fmt.Errorf("invalid duration %q", duration)
}
// ErrEmptyLayout empty layout error.
ErrEmptyLayout = func() error {
return fmt.Errorf("layout cannot be empty")
}
// ErrMismatchedLayout mismatched layout error.
ErrMismatchedLayout = func(value, layout string) error {
return fmt.Errorf("value %q and layout %q are mismatched", value, layout)
}
// ErrEmptyFormat empty format error.
ErrEmptyFormat = func() error {
return fmt.Errorf("format cannot be empty")
}
// ErrMismatchedFormat mismatched format error.
ErrMismatchedFormat = func(value, format string) error {
return fmt.Errorf("value %q and format %q are mismatched", value, format)
}
)