summaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-05 11:14:17 +0800
committerUnknwon <u@gogs.io>2015-08-05 11:14:17 +0800
commite50982f5ec78c3cfa4a1cf322f7fa1a4dea44b84 (patch)
treef6dffcf1c5a273a077a8b33c75334b9994ca02ff /models/error.go
parent487fc8ca39a3de565fc6c67aea72c4658bbf64c8 (diff)
downloadgitea-e50982f5ec78c3cfa4a1cf322f7fa1a4dea44b84.tar.gz
gitea-e50982f5ec78c3cfa4a1cf322f7fa1a4dea44b84.zip
allow anonymous SSH clone
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 04f850def9..067eace239 100644
--- a/models/error.go
+++ b/models/error.go
@@ -54,6 +54,20 @@ func (err ErrUserAlreadyExist) Error() string {
return fmt.Sprintf("user already exists: [name: %s]", err.Name)
}
+type ErrUserNotExist struct {
+ UID int64
+ Name string
+}
+
+func IsErrUserNotExist(err error) bool {
+ _, ok := err.(ErrUserNotExist)
+ return ok
+}
+
+func (err ErrUserNotExist) Error() string {
+ return fmt.Sprintf("user does not exist: [uid: %d, name: %s]", err.UID, err.Name)
+}
+
type ErrEmailAlreadyUsed struct {
Email string
}