aboutsummaryrefslogtreecommitdiff
path: root/models/errors/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/errors/repo.go')
-rw-r--r--models/errors/repo.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/models/errors/repo.go b/models/errors/repo.go
index 69c29be6..c9894af9 100644
--- a/models/errors/repo.go
+++ b/models/errors/repo.go
@@ -72,3 +72,16 @@ func IsBranchAlreadyExists(err error) bool {
func (err BranchAlreadyExists) Error() string {
return fmt.Sprintf("branch already exists [name: %s]", err.Name)
}
+
+type ErrBranchNotExist struct {
+ Name string
+}
+
+func IsErrBranchNotExist(err error) bool {
+ _, ok := err.(ErrBranchNotExist)
+ return ok
+}
+
+func (err ErrBranchNotExist) Error() string {
+ return fmt.Sprintf("branch does not exist [name: %s]", err.Name)
+}