-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy patherrors.go
29 lines (25 loc) · 804 Bytes
/
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
package rqp
// Error special rqp.Error type
type Error struct {
s string
}
func (e *Error) Error() string {
return e.s
}
// NewError constructor for internal errors
func NewError(msg string) *Error {
return &Error{msg}
}
// Errors list:
var (
ErrRequired = NewError("required")
ErrBadFormat = NewError("bad format")
ErrEmptyValue = NewError("empty value")
ErrUnknownMethod = NewError("unknown method")
ErrNotInScope = NewError("not in scope")
ErrSimilarNames = NewError("similar names of keys are not allowed")
ErrMethodNotAllowed = NewError("method are not allowed")
ErrFilterNotAllowed = NewError("filter are not allowed")
ErrFilterNotFound = NewError("filter not found")
ErrValidationNotFound = NewError("validation not found")
)