summaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-05 20:26:00 +0800
committerUnknwon <u@gogs.io>2015-08-05 20:26:00 +0800
commit2c507667bfd17f88dc4bfabc426c74cd5f8e4461 (patch)
tree31b267331f84d45a92f6a0bfe7eaafa124f4578f /models/error.go
parent0705f55ce097b9892a7c4c11faa5396c4e557232 (diff)
parentb9527cd1bfabcce3be62b43f0c199b1418519549 (diff)
downloadgitea-2c507667bfd17f88dc4bfabc426c74cd5f8e4461.tar.gz
gitea-2c507667bfd17f88dc4bfabc426c74cd5f8e4461.zip
Merge branch 'develop' of github.com:gogits/gogs into feature/milestone
# Conflicts: # gogs.go # models/issue.go # templates/.VERSION
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 01adeb425b..38a3c0534e 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
}