src/CarteBlanche/App/FrontController.php
public function renderError($params = null, $code = 404, $exception = null)
    {
        $mode_data = CarteBlanche::getKernelMode(true);
        if (!is_array($mode_data)
            || !isset($mode_data['debug'])
            || false==$mode_data['debug']
        ) {
            $action = 'error'.$code.'Action';
            $_ctrl = CarteBlanche::getContainer()
                ->get('locator')->locateController('Error');
            if (!empty($_ctrl) && class_exists($_ctrl)) {
                $_routes['controller'] = $_ctrl;
                $this->setController(new $_ctrl(CarteBlanche::getContainer()));
            } else {
                trigger_error("Controller 'Error' can't be found!", E_USER_ERROR);
            }

            // don't execute `shutdown` kernel steps
            CarteBlanche::getContainer()->get('kernel')
                ->setShutdown(false);

            return CodeHelper::fetchArguments(
                $action, $params, $this->getController()
            );
        } else {
            if (!empty($exception)) {
                if (!isset($params['message'])) $params['message'] = '';
                $params['message'] .= method_exists($exception, 'getAppMessage') ?
                    $exception->getAppMessage() : $exception->getMessage();
            }
            $debug = \CarteBlanche\App\Debugger::getInstance();
            $this->renderDebug($params, null, false);
            $params['title'] = $debug->getDebuggerTitle();
            $tpl = 'profiler/template_profiler';

            // don't execute `shutdown` kernel steps
//            CarteBlanche::getContainer()->get('kernel')->setShutdown(false);

            return $this->view($tpl, $params, true, true);
        }
    }
public function renderError($params = null, $code = 404, $exception = null)
    {
        $mode_data = CarteBlanche::getKernelMode(true);
        if (!is_array($mode_data)
            || !isset($mode_data['debug'])
            || false==$mode_data['debug']
        ) {
            $action = 'error'.$code.'Action';
            $_ctrl = CarteBlanche::getContainer()
                ->get('locator')->locateController('Error');
            if (!empty($_ctrl) && class_exists($_ctrl)) {
                $_routes['controller'] = $_ctrl;
                $this->setController(new $_ctrl(CarteBlanche::getContainer()));
            } else {
                trigger_error("Controller 'Error' can't be found!", E_USER_ERROR);
            }

            // don't execute `shutdown` kernel steps
            CarteBlanche::getContainer()->get('kernel')
                ->setShutdown(false);

            return CodeHelper::fetchArguments(
                $action, $params, $this->getController()
            );
        } else {
            if (!empty($exception)) {
                if (!isset($params['message'])) $params['message'] = '';
                $params['message'] .= method_exists($exception, 'getAppMessage') ?
                    $exception->getAppMessage() : $exception->getMessage();
            }
            $debug = \CarteBlanche\App\Debugger::getInstance();
            $this->renderDebug($params, null, false);
            $params['title'] = $debug->getDebuggerTitle();
            $tpl = 'profiler/template_profiler';

            // don't execute `shutdown` kernel steps
//            CarteBlanche::getContainer()->get('kernel')->setShutdown(false);

            return $this->view($tpl, $params, true, true);
        }
    }
Render an application error page view

@param   array       $params     An array of the parameters passed for the view parsing (passed by reference)
@param   int         $code       The error code
@param   null/string $exception    The exception info
@return  mixed
@see     self::render()
@see     self::view()