org.go 671 B

1234567891011121314151617181920212223242526
  1. // Copyright 2015 - Present, The Gogs Authors. All rights reserved.
  2. // Copyright 2018 - Present, Gitote. All rights reserved.
  3. //
  4. // This source code is licensed under the MIT license found in the
  5. // LICENSE file in the root directory of this source tree.
  6. package errors
  7. import "fmt"
  8. // TeamNotExist represents a "TeamNotExist" kind of error
  9. type TeamNotExist struct {
  10. TeamID int64
  11. Name string
  12. }
  13. // IsTeamNotExist checks if an error is a TeamNotExist
  14. func IsTeamNotExist(err error) bool {
  15. _, ok := err.(TeamNotExist)
  16. return ok
  17. }
  18. func (err TeamNotExist) Error() string {
  19. return fmt.Sprintf("team does not exist [team_id: %d, name: %s]", err.TeamID, err.Name)
  20. }