diff options
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index 029c33aba4..b079f06d84 100644 --- a/models/error.go +++ b/models/error.go @@ -1344,3 +1344,25 @@ func IsErrUnknownDependencyType(err error) bool { func (err ErrUnknownDependencyType) Error() string { return fmt.Sprintf("unknown dependency type [type: %d]", err.Type) } + +// __________ .__ +// \______ \ _______ _|__| ______ _ __ +// | _// __ \ \/ / |/ __ \ \/ \/ / +// | | \ ___/\ /| \ ___/\ / +// |____|_ /\___ >\_/ |__|\___ >\/\_/ +// \/ \/ \/ + +// ErrReviewNotExist represents a "ReviewNotExist" kind of error. +type ErrReviewNotExist struct { + ID int64 +} + +// IsErrReviewNotExist checks if an error is a ErrReviewNotExist. +func IsErrReviewNotExist(err error) bool { + _, ok := err.(ErrReviewNotExist) + return ok +} + +func (err ErrReviewNotExist) Error() string { + return fmt.Sprintf("review does not exist [id: %d]", err.ID) +} |