-
Notifications
You must be signed in to change notification settings - Fork 0
/
yamlerror.go
50 lines (36 loc) · 985 Bytes
/
yamlerror.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
package yamlconv
import "errors"
var (
ErrNotFoundError = errors.New("not found")
ErrInvalidIndexError = errors.New("invalid index")
ErrIndexOutOfRangeError = errors.New("index out of range")
ErrSearchKeyTooLongError = errors.New("too many keys")
)
type NotFoundError struct {
Err error
}
func (e *NotFoundError) Error() string {
return e.Err.Error()
}
func (e *NotFoundError) Unwrap() error { return e.Err }
type InvalidIndexError struct {
Err error
}
func (e *InvalidIndexError) Error() string {
return e.Err.Error()
}
func (e *InvalidIndexError) Unwrap() error { return e.Err }
type IndexOutOfRangeError struct {
Err error
}
func (e *IndexOutOfRangeError) Error() string {
return e.Err.Error()
}
func (e *IndexOutOfRangeError) Unwrap() error { return e.Err }
type SearchKeyTooLongError struct {
Err error
}
func (e *SearchKeyTooLongError) Error() string {
return e.Err.Error()
}
func (e *SearchKeyTooLongError) Unwrap() error { return e.Err }