index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
models
/
errors
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
Unknwon <u@gogs.io>
2018-12-01 21:41:30 -0500
committer
Unknwon <u@gogs.io>
2018-12-01 21:41:30 -0500
commit
69c1cd3f381b19b988a6af51a8e38303f216b001
(
patch
)
tree
5b9ce7c21380d8f2a2338516bba55cc75dbac60f
/
models/errors
parent
ce13fbb98a68a39b9b08f07bf7c7444e1e869451
(
diff
)
routes/api: change status handle to new style
Also fixed one bug that did not catch team not found error.
Diffstat
(limited to 'models/errors')
-rw-r--r--
models/errors/org.go
21
1 files changed, 21 insertions, 0 deletions
diff --git a/models/errors/org.go b/models/errors/org.go
new file mode 100644
index 00000000..56532746
--- /dev/null
+++ b/
models/errors/org.go
@@ -0,0 +1,21 @@
+// Copyright 2018 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package errors
+
+import "fmt"
+
+type TeamNotExist struct {
+ TeamID int64
+ Name string
+}
+
+func IsTeamNotExist(err error) bool {
+ _, ok := err.(TeamNotExist)
+ return ok
+}
+
+func (err TeamNotExist) Error() string {
+ return fmt.Sprintf("team does not exist [team_id: %d, name: %s]", err.TeamID, err.Name)
+}