mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
20 lines
313 B
Go
20 lines
313 B
Go
package sanitizedError
|
|
|
|
type customError struct {
|
|
message string
|
|
}
|
|
|
|
func (c customError) Error() string {
|
|
return c.message
|
|
}
|
|
|
|
func New(message string) error {
|
|
return customError{message: message}
|
|
}
|
|
|
|
func IsErrorSanitized(err error) bool {
|
|
if _, ok := err.(customError); !ok {
|
|
return false
|
|
}
|
|
return true
|
|
}
|