Loggest thy stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
312 B

  1. package slerrors
  2. type badRequestError struct {
  3. Text string
  4. }
  5. func (err *badRequestError) Error() string {
  6. return "validation failed: " + err.Text
  7. }
  8. func BadRequest(text string) error {
  9. return &badRequestError{Text: text}
  10. }
  11. func IsBadRequest(err error) bool {
  12. _, ok := err.(*badRequestError)
  13. return ok
  14. }