summaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-15 23:52:46 -0500
committerUnknwon <u@gogs.io>2015-11-15 23:52:46 -0500
commit18de67380c5049d6a4d10cc3f6f8fd80a9ac7a89 (patch)
treec5f142fdee161a61867756631ae63b439e7d902f /models/error.go
parent1a901433e2a27e5bcd29216fdb57082be620b745 (diff)
downloadgitea-18de67380c5049d6a4d10cc3f6f8fd80a9ac7a89.tar.gz
gitea-18de67380c5049d6a4d10cc3f6f8fd80a9ac7a89.zip
fix #1958
Diffstat (limited to 'models/error.go')
-rw-r--r--models/error.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go
index 8f508598a1..f8fea6f560 100644
--- a/models/error.go
+++ b/models/error.go
@@ -288,6 +288,32 @@ func (err ErrUpdateTaskNotExist) Error() string {
return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
}
+type ErrReleaseAlreadyExist struct {
+ TagName string
+}
+
+func IsErrReleaseAlreadyExist(err error) bool {
+ _, ok := err.(ErrReleaseAlreadyExist)
+ return ok
+}
+
+func (err ErrReleaseAlreadyExist) Error() string {
+ return fmt.Sprintf("Release tag already exist [tag_name: %s]", err.TagName)
+}
+
+type ErrReleaseNotExist struct {
+ TagName string
+}
+
+func IsErrReleaseNotExist(err error) bool {
+ _, ok := err.(ErrReleaseNotExist)
+ return ok
+}
+
+func (err ErrReleaseNotExist) Error() string {
+ return fmt.Sprintf("Release tag does not exist [tag_name: %s]", err.TagName)
+}
+
// __ __ ___. .__ __
// / \ / \ ____\_ |__ | |__ ____ ____ | | __
// \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /