1
0
Fork 0
forked from forgejo/forgejo

Redirects for renamed repos (#807)

* Redirects for renamed repos

* Remove unused phrase from locales
This commit is contained in:
Ethan Koenig 2017-02-05 09:35:03 -05:00 committed by Lunny Xiao
parent e86d935175
commit 027591a3a5
29 changed files with 127 additions and 27 deletions

View file

@ -408,6 +408,22 @@ func (err ErrRepoAlreadyExist) Error() string {
return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
}
// ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
type ErrRepoRedirectNotExist struct {
OwnerID int64
RepoName string
}
// IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist
func IsErrRepoRedirectNotExist(err error) bool {
_, ok := err.(ErrRepoRedirectNotExist)
return ok
}
func (err ErrRepoRedirectNotExist) Error() string {
return fmt.Sprintf("repository redirect does not exist [uid: %d, name: %s]", err.OwnerID, err.RepoName)
}
// ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
type ErrInvalidCloneAddr struct {
IsURLError bool