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
/
issue.go
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>
2017-03-22 13:20:29 -0400
committer
Unknwon <u@gogs.io>
2017-03-22 13:20:29 -0400
commit
85a050fca70446ea7a9e10266bbe083d5d8b63ea
(
patch
)
tree
23d3fcc2ce2fbd7f289477c1214ac0768e24d85b
/
models/errors/issue.go
parent
bb86d66496078b8c2fb242b6286d682ff9d5aa2f
(
diff
)
issue: fix redirect to random issue if index does not exist (#4315)
Diffstat
(limited to 'models/errors/issue.go')
-rw-r--r--
models/errors/issue.go
15
1 files changed, 15 insertions, 0 deletions
diff --git a/models/errors/issue.go b/models/errors/issue.go
index 4ea898fb..903cc977 100644
--- a/
models/errors/issue.go
+++ b/
models/errors/issue.go
@@ -6,6 +6,21 @@ package errors
import "fmt"
+type IssueNotExist struct {
+ ID int64
+ RepoID int64
+ Index int64
+}
+
+func IsIssueNotExist(err error) bool {
+ _, ok := err.(IssueNotExist)
+ return ok
+}
+
+func (err IssueNotExist) Error() string {
+ return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
+}
+
type InvalidIssueReference struct {
Ref string
}