(ctx iris.Context, code mvc.Code)
| 70 | type BaseControllerTest struct{} |
| 71 | |
| 72 | func (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 | |
| 83 | type UnauthenticatedUserController struct { |
| 84 | BaseControllerTest |
nothing calls this directly
no test coverage detected