mirror of
https://github.com/gogs/gogs.git
synced 2026-07-10 06:03:41 +02:00
models: move ErrBranchNotExist to errors package
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user