org.go 464 B

123456789101112131415161718192021
  1. // Copyright 2018 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package errors
  5. import "fmt"
  6. type TeamNotExist struct {
  7. TeamID int64
  8. Name string
  9. }
  10. func IsTeamNotExist(err error) bool {
  11. _, ok := err.(TeamNotExist)
  12. return ok
  13. }
  14. func (err TeamNotExist) Error() string {
  15. return fmt.Sprintf("team does not exist [team_id: %d, name: %s]", err.TeamID, err.Name)
  16. }