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

Method NotFound

context/context.go:1478–1480  ·  view source on GitHub ↗

NotFound emits an error 404 to the client, using the specific custom error error handler. Note that you may need to call ctx.StopExecution() if you don't want the next handlers to be executed. Next handlers are being executed on iris because you can alt the error code and change it to a more specifi

()

Source from the content-addressed store, hash-verified

1476// users := app.Party("/users")
1477// users.Done(func(ctx iris.Context){ if ctx.GetStatusCode() == 400 { /* custom error code for /users */ }})
1478func (ctx *Context) NotFound() {
1479 ctx.StatusCode(http.StatusNotFound)
1480}
1481
1482// GetStatusCode returns the current status code of the response.
1483// Look StatusCode too.

Callers 7

NextOrMethod · 0.95
GetMethod · 0.80
UpdateMethod · 0.80
DeleteMethod · 0.80
dispatchCommonFunction · 0.80
ApplyMethod · 0.80
StripPrefixFunction · 0.80

Calls 1

StatusCodeMethod · 0.95

Tested by

no test coverage detected