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

1234567891011121314151617181920212223242526
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Copyright 2018 Jonas Franz. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package migrations
  5. import (
  6. "errors"
  7. "github.com/google/go-github/v45/github"
  8. )
  9. // ErrRepoNotCreated returns the error that repository not created
  10. var ErrRepoNotCreated = errors.New("repository is not created yet")
  11. // IsRateLimitError returns true if the err is github.RateLimitError
  12. func IsRateLimitError(err error) bool {
  13. _, ok := err.(*github.RateLimitError)
  14. return ok
  15. }
  16. // IsTwoFactorAuthError returns true if the err is github.TwoFactorAuthError
  17. func IsTwoFactorAuthError(err error) bool {
  18. _, ok := err.(*github.TwoFactorAuthError)
  19. return ok
  20. }