diff options
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/models/error.go b/models/error.go index 0e554e52..91acd9cb 100644 --- a/models/error.go +++ b/models/error.go @@ -239,6 +239,26 @@ func (err ErrRepoAlreadyExist) Error() string { return fmt.Sprintf("repository already exists [uname: %d, name: %s]", err.Uname, err.Name) } +// .____ ___. .__ +// | | _____ \_ |__ ____ | | +// | | \__ \ | __ \_/ __ \| | +// | |___ / __ \| \_\ \ ___/| |__ +// |_______ (____ /___ /\___ >____/ +// \/ \/ \/ \/ + +type ErrLabelNotExist struct { + ID int64 +} + +func IsErrLabelNotExist(err error) bool { + _, ok := err.(ErrLabelNotExist) + return ok +} + +func (err ErrLabelNotExist) Error() string { + return fmt.Sprintf("label does not exist [id: %d]", err.ID) +} + // _____ .__.__ __ // / \ |__| | ____ _______/ |_ ____ ____ ____ // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \ @@ -247,7 +267,8 @@ func (err ErrRepoAlreadyExist) Error() string { // \/ \/ \/ \/ \/ type ErrMilestoneNotExist struct { - ID int64 + ID int64 + RepoID int64 } func IsErrMilestoneNotExist(err error) bool { @@ -256,5 +277,5 @@ func IsErrMilestoneNotExist(err error) bool { } func (err ErrMilestoneNotExist) Error() string { - return fmt.Sprintf("milestone does not exist [id: %d]", err.ID) + return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID) } |