diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-02-05 09:35:03 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-05 22:35:03 +0800 |
commit | 027591a3a556477a26d6c849e1ed9b9a53c15110 (patch) | |
tree | a2530f9419e864fbb68e6b38dd7b28ce58f592b6 /models/error.go | |
parent | e86d9351754f85b1508092b793dbd8a5cd1456f2 (diff) | |
download | gitea-027591a3a556477a26d6c849e1ed9b9a53c15110.tar.gz gitea-027591a3a556477a26d6c849e1ed9b9a53c15110.zip |
Redirects for renamed repos (#807)
* Redirects for renamed repos
* Remove unused phrase from locales
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index e0d33df6dc..8b0781f697 100644 --- a/models/error.go +++ b/models/error.go @@ -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 |