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

Method HandleHTTPError

mvc/controller_overlap_test.go:72–81  ·  view source on GitHub ↗
(ctx iris.Context, code mvc.Code)

Source from the content-addressed store, hash-verified

70type BaseControllerTest struct{}
71
72func (c *BaseControllerTest) HandleHTTPError(ctx iris.Context, code mvc.Code) (string, int) {
73 if ctx.GetStatusCode() != int(code) {
74 // should never happen.
75 panic("Context current status code and given mvc code do not match!")
76 }
77
78 ctrlName := ctx.Controller().Type().String()
79 newCode := 400
80 return fmt.Sprintf("error: %s: from: %d to: %d", ctrlName, int(code), newCode), newCode
81}
82
83type UnauthenticatedUserController struct {
84 BaseControllerTest

Callers

nothing calls this directly

Calls 4

GetStatusCodeMethod · 0.80
TypeMethod · 0.80
ControllerMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected