From c71458bee4239883a46f98d578192117f930e707 Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Fri, 26 Feb 2010 22:39:33 +0000 Subject: [PATCH] Code refactoring, #16 git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@116 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- app/FrontController.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/app/FrontController.php b/app/FrontController.php index 6ca28c7..5df27de 100644 --- a/app/FrontController.php +++ b/app/FrontController.php @@ -108,7 +108,7 @@ class FrontController { try { - //try { + try { $request = Env::getRequestUri(); $route = $this->getRouter()->route($request); if (!$route) { @@ -120,21 +120,15 @@ class FrontController $layout_class = $route->getLayout(); $layout = new $layout_class(); return $layout->fetch($action); - //} catch (GeneralException $e) { - // throw $e; - //} /*catch (Exception $e) { + } catch (GeneralException $e) { + throw $e; + } catch (Exception $e) { throw new GeneralException($e->getMessage(), $e->getCode()); - //} */ + } } catch (Exception $e) { - var_dump($e); - die('111'); - - /*if (DEBUG == true) { + if (DEBUG == true) { return $e->toHtml(); - } else { - $layout = new ErrorLayout(); - return $layout->fetch($e->getCode()); - } */ + } } } } \ No newline at end of file