Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com> Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com> Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
33 lines
646 B
Go
33 lines
646 B
Go
package errors
|
|
|
|
// Kind specifies the kind of error (unknown, parameter, integrity, etc).
|
|
type Kind uint32
|
|
|
|
const (
|
|
Other Kind = iota
|
|
Parameter
|
|
Integrity
|
|
Search
|
|
Password
|
|
Transaction
|
|
Encryption
|
|
Encoding
|
|
State
|
|
External
|
|
)
|
|
|
|
func (e Kind) String() string {
|
|
return map[Kind]string{
|
|
Other: "unknown",
|
|
Parameter: "parameter violation",
|
|
Integrity: "integrity violation",
|
|
Search: "search issue",
|
|
Password: "password violation",
|
|
Transaction: "db transaction issue",
|
|
Encryption: "encryption issue",
|
|
Encoding: "encoding issue",
|
|
State: "state violation",
|
|
External: "external system issue",
|
|
}[e]
|
|
}
|