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

Function onErrorCode

_examples/routing/http-errors/reset-body/main.go:26–32  ·  view source on GitHub ↗

This is the default error handler Iris uses for any error codes.

(ctx iris.Context)

Source from the content-addressed store, hash-verified

24
25// This is the default error handler Iris uses for any error codes.
26func onErrorCode(ctx iris.Context) {
27 if err := ctx.GetErr(); err != nil {
28 ctx.WriteString(err.Error())
29 } else {
30 ctx.WriteString(iris.StatusText(ctx.GetStatusCode()))
31 }
32}
33
34func handler(ctx iris.Context) {
35 ctx.Record()

Callers

nothing calls this directly

Calls 4

GetErrMethod · 0.80
WriteStringMethod · 0.80
GetStatusCodeMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…