diff options
author | Unknwon <u@gogs.io> | 2015-11-15 23:52:46 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-15 23:52:46 -0500 |
commit | 18de67380c5049d6a4d10cc3f6f8fd80a9ac7a89 (patch) | |
tree | c5f142fdee161a61867756631ae63b439e7d902f /models/error.go | |
parent | 1a901433e2a27e5bcd29216fdb57082be620b745 (diff) | |
download | gitea-18de67380c5049d6a4d10cc3f6f8fd80a9ac7a89.tar.gz gitea-18de67380c5049d6a4d10cc3f6f8fd80a9ac7a89.zip |
fix #1958
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 26 |
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) +} + // __ __ ___. .__ __ // / \ / \ ____\_ |__ | |__ ____ ____ | | __ // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ / |