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.

22 lines
329 B

4 years ago
  1. package slerrors
  2. type forbiddenError struct {
  3. Message string
  4. }
  5. func (e *forbiddenError) Error() string {
  6. return e.Message
  7. }
  8. func Forbidden(message string) error {
  9. return &forbiddenError{Message: message}
  10. }
  11. func IsForbidden(err error) bool {
  12. if err == nil {
  13. return false
  14. }
  15. _, ok := err.(*forbiddenError)
  16. return ok
  17. }