-
Notifications
You must be signed in to change notification settings - Fork 2
/
errors.go
108 lines (83 loc) · 2.31 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
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
package ksql
import (
"fmt"
)
// Lexer errors
// ErrUnsupportedCharacter represents an unsupported character is expression being lexed.
type ErrUnsupportedCharacter struct {
b byte
}
func (e ErrUnsupportedCharacter) Error() string {
return fmt.Sprintf("Unsupported Character `%s`", string(e.b))
}
// ErrUnterminatedString represents an unterminated string
type ErrUnterminatedString struct {
s string
}
func (e ErrUnterminatedString) Error() string {
return fmt.Sprintf("Unterminated string `%s`", e.s)
}
// ErrInvalidSelectorPath represents an invalid selector string
type ErrInvalidSelectorPath struct {
s string
}
func (e ErrInvalidSelectorPath) Error() string {
return fmt.Sprintf("Invalid selector path `%s`", e.s)
}
// ErrInvalidBool represents an invalid boolean
type ErrInvalidBool struct {
s string
}
func (e ErrInvalidBool) Error() string {
return fmt.Sprintf("Invalid boolean `%s`", e.s)
}
// ErrInvalidKeyword represents an invalid keyword keyword
type ErrInvalidKeyword struct {
s string
}
func (e ErrInvalidKeyword) Error() string {
return fmt.Sprintf("Invalid keyword `%s`", e.s)
}
// ErrInvalidNumber represents an invalid number
type ErrInvalidNumber struct {
s string
}
func (e ErrInvalidNumber) Error() string {
return fmt.Sprintf("Invalid number `%s`", e.s)
}
// Parser errors
// ErrUnsupportedTypeComparison represents a comparison of incompatible types
type ErrUnsupportedTypeComparison struct {
s string
}
func (e ErrUnsupportedTypeComparison) Error() string {
return fmt.Sprintf("unsupported type comparison: `%s`", e.s)
}
// ErrInvalidIdentifier represents an invalid identifier
type ErrInvalidIdentifier struct {
s string
}
func (e ErrInvalidIdentifier) Error() string {
return fmt.Sprintf("Invalid identifier `%s`", e.s)
}
// ErrUnsupportedCoerce represents a comparison of incompatible types type casts
type ErrUnsupportedCoerce struct {
s string
}
func (e ErrUnsupportedCoerce) Error() string {
return fmt.Sprintf("unsupported type comparison for COERCE: `%s`", e.s)
}
// ErrCustom represents a custom error
type ErrCustom struct {
S string
}
func (e ErrCustom) Error() string {
return e.S
}
// ErrInvalidCoerce represents an invalid Coerce error
type ErrInvalidCoerce struct {
Err error
}
func (e ErrInvalidCoerce) Error() string {
return fmt.Sprintf("invalid COERCE: `%s`", e.Err.Error())
}