diff options
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index 91acd9cb..8fc0ba77 100644 --- a/models/error.go +++ b/models/error.go @@ -279,3 +279,24 @@ func IsErrMilestoneNotExist(err error) bool { func (err ErrMilestoneNotExist) Error() string { return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID) } + +// _____ __ __ .__ __ +// / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_ +// / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\ +// / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ | +// \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__| +// \/ \/ \/ \/ \/ \/ \/ + +type ErrAttachmentNotExist struct { + ID int64 + UUID string +} + +func IsErrAttachmentNotExist(err error) bool { + _, ok := err.(ErrAttachmentNotExist) + return ok +} + +func (err ErrAttachmentNotExist) Error() string { + return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID) +} |