2020-11-04 14:42:20 -05:00
|
|
|
package errors
|
|
|
|
|
|
|
|
|
|
// Kind specifies the kind of error (unknown, parameter, integrity, etc).
|
|
|
|
|
type Kind uint32
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
Other Kind = iota
|
|
|
|
|
Parameter
|
|
|
|
|
Integrity
|
|
|
|
|
Search
|
2020-12-21 10:07:34 -08:00
|
|
|
Password
|
|
|
|
|
Transaction
|
2020-11-04 14:42:20 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (e Kind) String() string {
|
|
|
|
|
return map[Kind]string{
|
2020-12-21 10:07:34 -08:00
|
|
|
Other: "unknown",
|
|
|
|
|
Parameter: "parameter violation",
|
|
|
|
|
Integrity: "integrity violation",
|
|
|
|
|
Search: "search issue",
|
|
|
|
|
Password: "password violation",
|
|
|
|
|
Transaction: "db transaction issue",
|
2020-11-04 14:42:20 -05:00
|
|
|
}[e]
|
|
|
|
|
}
|