MCPcopy Create free account
hub / github.com/kataras/iris / registerErrors

Function registerErrors

_examples/routing/main.go:18–23  ·  view source on GitHub ↗
(app *iris.Application)

Source from the content-addressed store, hash-verified

16const notFoundHTML = "<h1> custom http error page </h1>"
17
18func registerErrors(app *iris.Application) {
19 // set a custom 404 handler
20 app.OnErrorCode(iris.StatusNotFound, func(ctx iris.Context) {
21 ctx.HTML(notFoundHTML)
22 })
23}
24
25func registerGamesRoutes(app *iris.Application) {
26 gamesMiddleware := func(ctx iris.Context) {

Callers 1

newAppFunction · 0.85

Calls 2

OnErrorCodeMethod · 0.65
HTMLMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…