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 775B

123456789101112131415161718192021222324252627
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Copyright 2018 Jonas Franz. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package migrations
  6. import (
  7. "errors"
  8. "github.com/google/go-github/v39/github"
  9. )
  10. // ErrRepoNotCreated returns the error that repository not created
  11. var ErrRepoNotCreated = errors.New("repository is not created yet")
  12. // IsRateLimitError returns true if the err is github.RateLimitError
  13. func IsRateLimitError(err error) bool {
  14. _, ok := err.(*github.RateLimitError)
  15. return ok
  16. }
  17. // IsTwoFactorAuthError returns true if the err is github.TwoFactorAuthError
  18. func IsTwoFactorAuthError(err error) bool {
  19. _, ok := err.(*github.TwoFactorAuthError)
  20. return ok
  21. }