summaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-08 17:10:34 +0800
committerUnknwon <u@gogs.io>2015-08-08 17:10:34 +0800
commit9db4acc62e2d253c21ce9aed2e21003ff235d5b5 (patch)
tree1718b390dce8fb2e0771f4033cb1f6b24d66f0b3 /models/error.go
parente6862e9cec49acf1cf8bbb5d1baee299a52b4967 (diff)
downloadgitea-9db4acc62e2d253c21ce9aed2e21003ff235d5b5.tar.gz
gitea-9db4acc62e2d253c21ce9aed2e21003ff235d5b5.zip
improve fork process
Diffstat (limited to 'models/error.go')
-rw-r--r--models/error.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go
index e52d9b16d9..0e554e5273 100644
--- a/models/error.go
+++ b/models/error.go
@@ -225,6 +225,20 @@ func (err ErrRepoNotExist) Error() string {
return fmt.Sprintf("repository does not exist [id: %d, uid: %d, name: %s]", err.ID, err.UID, err.Name)
}
+type ErrRepoAlreadyExist struct {
+ Uname string
+ Name string
+}
+
+func IsErrRepoAlreadyExist(err error) bool {
+ _, ok := err.(ErrRepoAlreadyExist)
+ return ok
+}
+
+func (err ErrRepoAlreadyExist) Error() string {
+ return fmt.Sprintf("repository already exists [uname: %d, name: %s]", err.Uname, err.Name)
+}
+
// _____ .__.__ __
// / \ |__| | ____ _______/ |_ ____ ____ ____
// / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \