models: move ErrBranchNotExist to errors package

This commit is contained in:
Unknwon
2018-03-08 07:15:55 -05:00
parent 51e087fd87
commit 1f7983059a
6 changed files with 22 additions and 27 deletions

View File

@@ -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)
}