src/Yggdrasil/Core/Kernel.php
private function handleError(Request $request, Response $response)
    {
        $controllerName = $this->getRouter()->getConfiguration()->getControllerNamespace() . 'ErrorController';

        if (!class_exists($controllerName)) {
            return $response;
        }

        $actionName = 'code' . $response->getStatusCode() . 'Action';

        if (!method_exists($controllerName, $actionName)) {
            $actionName = 'defaultAction';
        }

        $controller = new $controllerName($this->drivers, $request, $response);

        return $controller->{$actionName}();
    }
private function handleError(Request $request, Response $response)
    {
        $controllerName = $this->getRouter()->getConfiguration()->getControllerNamespace() . 'ErrorController';

        if (!class_exists($controllerName)) {
            return $response;
        }

        $actionName = 'code' . $response->getStatusCode() . 'Action';

        if (!method_exists($controllerName, $actionName)) {
            $actionName = 'defaultAction';
        }

        $controller = new $controllerName($this->drivers, $request, $response);

        return $controller->{$actionName}();
    }
private function handleError ( Request $ request , Response $ response ) { $ controllerName = $ this -> getRouter ( ) -> getConfiguration ( ) -> getControllerNamespace ( ) . 'ErrorController' ; if ( ! class_exists ( $ controllerName ) ) { return $ response ; } $ actionName = 'code' . $ response -> getStatusCode ( ) . 'Action' ; if ( ! method_exists ( $ controllerName , $ actionName ) ) { $ actionName = 'defaultAction' ; } $ controller = new $ controllerName ( $ this -> drivers , $ request , $ response ) ; return $ controller -> { $ actionName } ( ) ; }
Handles HTTP errors, that may occur on action execution stage

@param Request  $request
@param Response $response Response returned by action execution
@return mixed|Response
Handles HTTP errors that may occur on action execution stage