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.

error.go 903B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2015 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 models
  5. import (
  6. "fmt"
  7. )
  8. // __________ .__ __
  9. // \______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__.
  10. // | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | |
  11. // | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ |
  12. // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____|
  13. // \/ \/|__| \/ \/
  14. type ErrRepoNotExist struct {
  15. ID int64
  16. UID int64
  17. Name string
  18. }
  19. func IsErrRepoNotExist(err error) bool {
  20. _, ok := err.(ErrRepoNotExist)
  21. return ok
  22. }
  23. func (err ErrRepoNotExist) Error() string {
  24. return fmt.Sprintf("repository does not exist [id: %d, uid: %d, name: %s]", err.ID, err.UID, err.Name)
  25. }