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

Method handleHTTPError

mvc/controller.go:461–472  ·  view source on GitHub ↗

handleHTTPError is called when a controller's method with the "HandleHTTPError" is found. That method can accept dependencies like the rest but if it's not called manually then any dynamic dependencies depending on successful requests may fail - this is end-developer's job; to register the correct d

(funcName string)

Source from the content-addressed store, hash-verified

459// on the controller (or method) level that will select
460// between the two should exist (see mvc/authenticated-controller example).
461func (c *ControllerActivator) handleHTTPError(funcName string) *router.Route {
462 handler := c.handlerOf("/", funcName)
463
464 routes := c.app.Router.OnAnyErrorCode(handler)
465 if len(routes) == 0 {
466 c.logErrorf("MVC: unable to register an HTTP error code handler for '%s.%s'", c.fullName, funcName)
467 return nil
468 }
469
470 c.saveRoutes(funcName, routes, true)
471 return routes[0]
472}
473
474// HandleMany like `Handle` but can register more than one path and HTTP method routes
475// separated by whitespace on the same controller's method.

Callers 1

parseHTTPErrorHandlerMethod · 0.95

Calls 4

handlerOfMethod · 0.95
logErrorfMethod · 0.95
saveRoutesMethod · 0.95
OnAnyErrorCodeMethod · 0.65

Tested by

no test coverage detected