Exemplo n.º 1
0
 /**
  * construct
  * @param Exception $exception the exception
  */
 public function __construct($exception)
 {
     $this->request = Request::getInstance();
     $save['controller'] = $this->request->controller;
     $this->request->controller = 'ErrorController';
     $save['action'] = $this->request->action;
     $this->request->params = ['error' => $exception];
     $this->view = new HtmlView();
     $this->view->set($save);
     $this->_loadTools();
     if (Config::getDebug()) {
         $this->request->action = 'error';
         $this->error($exception);
     } else {
         $this->request->action = 'error404';
         $this->error404($exception);
     }
     $this->view->render();
 }