diff options
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/models/error.go b/models/error.go index 69b2962475..a6cf31218c 100644 --- a/models/error.go +++ b/models/error.go @@ -387,7 +387,7 @@ func IsErrReleaseAlreadyExist(err error) bool { } func (err ErrReleaseAlreadyExist) Error() string { - return fmt.Sprintf("Release tag already exist [tag_name: %s]", err.TagName) + return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName) } type ErrReleaseNotExist struct { @@ -401,7 +401,20 @@ func IsErrReleaseNotExist(err error) bool { } func (err ErrReleaseNotExist) Error() string { - return fmt.Sprintf("Release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName) + return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName) +} + +type ErrInvalidTagName struct { + TagName string +} + +func IsErrInvalidTagName(err error) bool { + _, ok := err.(ErrInvalidTagName) + return ok +} + +func (err ErrInvalidTagName) Error() string { + return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName) } // __________ .__ @@ -421,7 +434,7 @@ func IsErrBranchNotExist(err error) bool { } func (err ErrBranchNotExist) Error() string { - return fmt.Sprintf("Branch does not exist [name: %s]", err.Name) + return fmt.Sprintf("branch does not exist [name: %s]", err.Name) } // __ __ ___. .__ __ |