-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.go
199 lines (154 loc) · 5.87 KB
/
error.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
package leblad
import "strconv"
// WilayaListError is the error returned when getting the wilaya list
type WilayaListError struct{}
// Error returns the error message
func (e *WilayaListError) Error() string {
return "error getting wilaya list"
}
// WilayaByZipCodeError is the error returned when getting a wilaya by zip code
type WilayaByZipCodeError struct {
ZipCode int
}
// Error returns the error message
func (e *WilayaByZipCodeError) Error() string {
return "error getting wilaya by zip code " + strconv.Itoa(e.ZipCode)
}
// WilayaByCodeError is the error returned when getting a wilaya by code
type WilayaByCodeError struct {
Code int
}
// Error returns the error message
func (e *WilayaByCodeError) Error() string {
return "error getting wilaya by code " + strconv.Itoa(e.Code)
}
// AdjacentWilayasError is the error returned when getting adjacent wilayas
type AdjacentWilayasError struct{}
// Error returns the error message
func (e *AdjacentWilayasError) Error() string {
return "error getting adjacent wilayas"
}
// ZipCodesForWilayaError is the error returned when getting zip codes for a wilaya
type ZipCodesForWilayaError struct{}
// Error returns the error message
func (e *ZipCodesForWilayaError) Error() string {
return "error getting zip codes for wilaya"
}
// WilayaByPhoneCodeError is the error returned when getting a wilaya by phone code
type WilayaByPhoneCodeError struct {
PhoneCode int
}
// Error returns the error message
func (e *WilayaByPhoneCodeError) Error() string {
return "error getting wilaya by phone code " + strconv.Itoa(e.PhoneCode)
}
// WilayaByDairaError is the error returned when getting a wilaya by daira
type WilayaByDairaNameError struct {
DairaName string
}
// Error returns the error message
func (e *WilayaByDairaNameError) Error() string {
return "error getting wilaya by daira " + e.DairaName
}
// BaladiyatsForDairaError is the error returned when getting baladiyats for a daira
type BaladyiatsForDairaError struct{}
// Error returns the error message
func (e *BaladyiatsForDairaError) Error() string {
return "error getting baladiyats for daira"
}
// DairatsForWilayaError is the error returned when getting dairats for a wilaya
type DairatsForWilayaError struct{}
// Error returns the error message
func (e *DairatsForWilayaError) Error() string {
return "error getting dairats for wilaya"
}
// WilayaByDairaCodeError is the error returned when getting a wilaya by daira code
type WilayaByDairaCodeError struct {
DairaCode int
}
// Error returns the error message
func (e *WilayaByDairaCodeError) Error() string {
return "error getting wilaya by daira code " + strconv.Itoa(e.DairaCode)
}
// DairaByDairaCodeError is the error returned when getting a daira by daira code
type DairaByDairaCodeError struct {
DairaCode int
}
// Error returns the error message
func (e *DairaByDairaCodeError) Error() string {
return "error getting daira by daira code " + strconv.Itoa(e.DairaCode)
}
// DairaByDairaNameError is the error returned when getting a daira by daira name
type DairaByDairaNameError struct {
DairaName string
}
// Error returns the error message
func (e *DairaByDairaNameError) Error() string {
return "error getting daira by daira name " + e.DairaName
}
// WilayaByWilayaNameError is the error returned when getting a wilaya by wilaya name
type WilayaByWilayaNameError struct {
WilayaName string
}
// Error returns the error message
func (e *WilayaByWilayaNameError) Error() string {
return "error getting wilaya by wilaya name " + e.WilayaName
}
// BaladyiatsForWilayaError is the error returned when getting baladyiats for a wilaya
type BaladyiatsForWilayaError struct{}
// Error returns the error message
func (e *BaladyiatsForWilayaError) Error() string {
return "error getting baladyiats for wilaya"
}
// WilayaByBaladyiaNameError is the error returned when getting a wilaya by baladyia name
type WilayaByBaladyiaNameError struct {
BaladyiaName string
}
// Error returns the error message
func (e *WilayaByBaladyiaNameError) Error() string {
return "error getting wilaya by baladyia name " + e.BaladyiaName
}
// DairaByBaladyiaNameError is the error returned when getting a daira by baladyia name
type DairaByBaladyiaNameError struct {
BaladyiaName string
}
// Error returns the error message
func (e *DairaByBaladyiaNameError) Error() string {
return "error getting daira by baladyia name " + e.BaladyiaName
}
// PhoneCodesForWilayaError is the error returned when getting phone codes for a wilaya
type PhoneCodesForWilayaError struct{}
// Error returns the error message
func (e *PhoneCodesForWilayaError) Error() string {
return "error getting phone codes for wilaya"
}
// FirstPhoneCodeForWilayaError is the error returned when getting the first phone code for a wilaya
type FirstPhoneCodeForWilayaError struct{}
// Error returns the error message
func (e *FirstPhoneCodeForWilayaError) Error() string {
return "error getting first phone code for wilaya"
}
// BaladiyatsForWilayaError is the error returned when getting baladiyats for a wilaya
type BaladiyatsForWilayaError struct{}
// Error returns the error message
func (e *BaladiyatsForWilayaError) Error() string {
return "error getting baladiyats for wilaya"
}
// WilayaByBaladiyaError is the error returned when getting a wilaya by baladiya
type WilayaByBaladiyaError struct{}
// Error returns the error message
func (e *WilayaByBaladiyaError) Error() string {
return "error getting wilaya by baladiya"
}
// DairaByBaladiyaError is the error returned when getting a daira by baladiya
type DairaByBaladiyaError struct{}
// Error returns the error message
func (e *DairaByBaladiyaError) Error() string {
return "error getting daira by baladiya"
}
// FullAdjacentWilayasError is the error returned when getting full adjacent wilayas
type FullAdjacentWilayasError struct{}
// Error returns the error message
func (e *FullAdjacentWilayasError) Error() string {
return "error getting full adjacent wilayas"
}