summaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-12-02 15:34:39 +0800
committerGitHub <noreply@github.com>2017-12-02 15:34:39 +0800
commit35cc5b0402d46d672e02bbe1ad15d1460077e8f4 (patch)
tree47723925eb89e286f328503ae30e77ca1eaaf021 /models/error.go
parent674422b642452050a7185f10908a9e8a86604f24 (diff)
downloadgitea-35cc5b0402d46d672e02bbe1ad15d1460077e8f4.tar.gz
gitea-35cc5b0402d46d672e02bbe1ad15d1460077e8f4.zip
Remove GetRepositoryByRef and add GetRepositoryByOwnerAndName (#3043)
* remove GetRepositoryByRef and add GetRepositoryByOwnerAndName * fix tests * fix tests bug * some improvements
Diffstat (limited to 'models/error.go')
-rw-r--r--models/error.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/models/error.go b/models/error.go
index 50d9cba171..fceee21fdf 100644
--- a/models/error.go
+++ b/models/error.go
@@ -572,9 +572,10 @@ func (err ErrLFSLockAlreadyExist) Error() string {
// ErrRepoNotExist represents a "RepoNotExist" kind of error.
type ErrRepoNotExist struct {
- ID int64
- UID int64
- Name string
+ ID int64
+ UID int64
+ OwnerName string
+ Name string
}
// IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
@@ -584,7 +585,8 @@ func IsErrRepoNotExist(err error) bool {
}
func (err ErrRepoNotExist) Error() string {
- return fmt.Sprintf("repository does not exist [id: %d, uid: %d, name: %s]", err.ID, err.UID, err.Name)
+ return fmt.Sprintf("repository does not exist [id: %d, uid: %d, owner_name: %s, name: %s]",
+ err.ID, err.UID, err.OwnerName, err.Name)
}
// ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.