Exemple #1
0
 /**
  * Try to run action basing on query URI.
  * Catch Vero\App\Exception to display nice messages by exceptionHandler Action.
  */
 public function run()
 {
     $request = $this->container->get('request');
     ob_start();
     try {
         if (!($class = $this->findAction($request))) {
             throw Exception\NotFound::url($request->url());
         }
         $this->sendResponse($this->getAction($class)->run($request));
     } catch (App\Exception $e) {
         if (!$this->exceptionHandler) {
             throw $e;
         }
         $request->setParam('exception', $e);
         $this->sendResponse($this->getAction($this->exceptionHandler)->run($request));
     }
 }
Exemple #2
0
 /**
  * @return Exception\NotFound
  */
 public function notFound()
 {
     return Exception\NotFound::url($this->get('request')->url());
 }