MCPcopy Create free account
hub / github.com/gogs/gogs / NotFoundOrError

Method NotFoundOrError

internal/context/context.go:184–190  ·  view source on GitHub ↗

NotFoundOrError responses with 404 page for not found error and 500 page otherwise.

(err error, msg string)

Source from the content-addressed store, hash-verified

182
183// NotFoundOrError responses with 404 page for not found error and 500 page otherwise.
184func (c *Context) NotFoundOrError(err error, msg string) {
185 if errutil.IsNotFound(err) {
186 c.NotFound()
187 return
188 }
189 c.Error(err, msg)
190}
191
192// NotFoundOrErrorf is same as NotFoundOrError but with formatted message.
193func (c *Context) NotFoundOrErrorf(err error, format string, args ...any) {

Callers 1

NotFoundOrErrorfMethod · 0.95

Calls 3

NotFoundMethod · 0.95
ErrorMethod · 0.95
IsNotFoundFunction · 0.92

Tested by

no test coverage detected