form - errors.go
1 package form
2
3 import (
4 "errors"
5 )
6
7 // Errors is a list of errors that occured when processing a slice of processors
8 type Errors []error
9
10 // Error implements the error interface
11 func (Errors) Error() string {
12 return "multiple error occurred"
13 }
14
15 // ErrorMap is a map of all of the keys that experienced errors
16 type ErrorMap map[string]error
17
18 // Error implements the error interface
19 func (ErrorMap) Error() string {
20 return "errors occurred during processing form data"
21 }
22
23 // Errors
24 var (
25 ErrNeedPointer = errors.New("need pointer to type")
26 ErrNeedStruct = errors.New("need struct type")
27 ErrNotInRange = errors.New("value not in valid range")
28 ErrInvalidBoolean = errors.New("invalid boolean")
29 ErrRequiredMissing = errors.New("required field is missing")
30 ErrNoMatch = errors.New("string did not match regex")
31 )