Files
stufflog3/internal/slerrors/badrequest.go
T

19 lines
312 B
Go

package slerrors
type badRequestError struct {
Text string
}
func (err *badRequestError) Error() string {
return "validation failed: " + err.Text
}
func BadRequest(text string) error {
return &badRequestError{Text: text}
}
func IsBadRequest(err error) bool {
_, ok := err.(*badRequestError)
return ok
}