forked from forgejo/forgejo
Various wiki bug fixes (#2996)
* Update macaron * Various wiki bug fixes
This commit is contained in:
parent
6a58e3f9fc
commit
b7ebaf6d20
40 changed files with 1087 additions and 381 deletions
|
@ -191,7 +191,7 @@ type ErrWikiAlreadyExist struct {
|
|||
Title string
|
||||
}
|
||||
|
||||
// IsErrWikiAlreadyExist checks if an error is a ErrWikiAlreadyExist.
|
||||
// IsErrWikiAlreadyExist checks if an error is an ErrWikiAlreadyExist.
|
||||
func IsErrWikiAlreadyExist(err error) bool {
|
||||
_, ok := err.(ErrWikiAlreadyExist)
|
||||
return ok
|
||||
|
@ -201,6 +201,21 @@ func (err ErrWikiAlreadyExist) Error() string {
|
|||
return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
|
||||
}
|
||||
|
||||
// ErrWikiReservedName represents a reserved name error.
|
||||
type ErrWikiReservedName struct {
|
||||
Title string
|
||||
}
|
||||
|
||||
// IsErrWikiReservedName checks if an error is an ErrWikiReservedName.
|
||||
func IsErrWikiReservedName(err error) bool {
|
||||
_, ok := err.(ErrWikiReservedName)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrWikiReservedName) Error() string {
|
||||
return fmt.Sprintf("wiki title is reserved: %s", err.Title)
|
||||
}
|
||||
|
||||
// __________ ___. .__ .__ ____ __.
|
||||
// \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__.
|
||||
// | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue