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)
| 459 | // on the controller (or method) level that will select |
| 460 | // between the two should exist (see mvc/authenticated-controller example). |
| 461 | func (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. |
no test coverage detected