From e42fcb033d4a7ee44fe397be3e933d7031b7d8f7 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 27 Nov 2015 01:50:38 -0500 Subject: wiki: finish edit --- models/error.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'models/error.go') diff --git a/models/error.go b/models/error.go index 069346be..d005b9af 100644 --- a/models/error.go +++ b/models/error.go @@ -107,6 +107,26 @@ func (err ErrUserHasOrgs) Error() string { return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID) } +// __ __.__ __ .__ +// / \ / \__| | _|__| +// \ \/\/ / | |/ / | +// \ /| | <| | +// \__/\ / |__|__|_ \__| +// \/ \/ + +type ErrWikiAlreadyExist struct { + Title string +} + +func IsErrWikiAlreadyExist(err error) bool { + _, ok := err.(ErrWikiAlreadyExist) + return ok +} + +func (err ErrWikiAlreadyExist) Error() string { + return fmt.Sprintf("wiki page already exists [title: %s]", err.Title) +} + // __________ ___. .__ .__ ____ __. // \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__. // | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | | -- cgit v1.2.3