-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
52 lines (41 loc) · 1.15 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
package gtfs
import "fmt"
type MissingStructError struct {
Container string
Id string
}
func (e *MissingStructError) Error() string {
return fmt.Sprintf("missing struct in %s with id %s", e.Container, e.Id)
}
type RequirementError struct {
Struct string
Field string
}
func (e *RequirementError) Error() string {
return fmt.Sprintf("requirement error: %s.%s", e.Struct, e.Field)
}
type ConditionnalRequirementError struct {
Struct string
Field string
Condition string
}
func (e *ConditionnalRequirementError) Error() string {
return fmt.Sprintf("conditional requirement error %s.%s: %s", e.Struct, e.Field, e.Condition)
}
type ReferenceError struct {
Struct string
Field string
Destination string
Value string
}
func (e *ReferenceError) Error() string {
return fmt.Sprintf("reference error in %s.%s to %s: %s", e.Struct, e.Field, e.Destination, e.Value)
}
type InvalidValueError struct {
Struct string
Field string
Value interface{}
}
func (e *InvalidValueError) Error() string {
return fmt.Sprintf("invalid value error in %s.%s: %v", e.Struct, e.Field, e.Value)
}