diff options
Diffstat (limited to 'models/repo/topic.go')
-rw-r--r-- | models/repo/topic.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/repo/topic.go b/models/repo/topic.go index 7ba9a49e89..33bbb05af9 100644 --- a/models/repo/topic.go +++ b/models/repo/topic.go @@ -13,6 +13,7 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/modules/container" "code.gitea.io/gitea/modules/timeutil" + "code.gitea.io/gitea/modules/util" "xorm.io/builder" ) @@ -55,6 +56,10 @@ func (err ErrTopicNotExist) Error() string { return fmt.Sprintf("topic is not exist [name: %s]", err.Name) } +func (err ErrTopicNotExist) Unwrap() error { + return util.ErrNotExist +} + // ValidateTopic checks a topic by length and match pattern rules func ValidateTopic(topic string) bool { return len(topic) <= 35 && topicPattern.MatchString(topic) |