diff options
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index 3b05a7152c..e9343cbe7c 100644 --- a/models/error.go +++ b/models/error.go @@ -995,6 +995,21 @@ func IsErrWontSign(err error) bool { // |______ / |__| (____ /___| /\___ >___| / // \/ \/ \/ \/ \/ +// ErrBranchDoesNotExist represents an error that branch with such name does not exist. +type ErrBranchDoesNotExist struct { + BranchName string +} + +// IsErrBranchDoesNotExist checks if an error is an ErrBranchDoesNotExist. +func IsErrBranchDoesNotExist(err error) bool { + _, ok := err.(ErrBranchDoesNotExist) + return ok +} + +func (err ErrBranchDoesNotExist) Error() string { + return fmt.Sprintf("branch does not exist [name: %s]", err.BranchName) +} + // ErrBranchAlreadyExists represents an error that branch with such name already exists. type ErrBranchAlreadyExists struct { BranchName string |