diff options
| author | 2013-11-09 21:33:43 +0100 | |
|---|---|---|
| committer | 2013-11-09 21:33:43 +0100 | |
| commit | a1fa4a445ad6a8b12fe606764588b619edab8d8f (patch) | |
| tree | 27a24450906d0853ad28527e69f3d4a04ec0f666 /lib/minz/FrontController.php | |
| parent | 33b68a801734999504d3dfe811bb71582f7b9b0d (diff) | |
Ajout de messages en cas de mauvaise configuration
Si fichier de conf inaccessible / mal configuré ou fichier de log
inaccessible, on affiche des messages plus explicites qu'une page
blanche
Diffstat (limited to 'lib/minz/FrontController.php')
| -rwxr-xr-x | lib/minz/FrontController.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/minz/FrontController.php b/lib/minz/FrontController.php index 67ed89f46..d48d43d04 100755 --- a/lib/minz/FrontController.php +++ b/lib/minz/FrontController.php @@ -41,7 +41,7 @@ class FrontController { Configuration::init (); Request::init (); - + $this->router = new Router (); $this->router->init (); } catch (RouteNotFoundException $e) { @@ -52,7 +52,7 @@ class FrontController { ); } catch (MinzException $e) { Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); - $this->killApp (); + $this->killApp ($e->getMessage ()); } $this->dispatcher = Dispatcher::getInstance ($this->router); @@ -94,12 +94,16 @@ class FrontController { $this->dispatcher->run (); Response::send (); } catch (MinzException $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); + try { + Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); + } catch (PermissionDeniedException $e) { + $this->killApp ($e->getMessage ()); + } if ($e instanceof FileNotExistException || - $e instanceof ControllerNotExistException || - $e instanceof ControllerNotActionControllerException || - $e instanceof ActionException) { + $e instanceof ControllerNotExistException || + $e instanceof ControllerNotActionControllerException || + $e instanceof ActionException) { Error::error ( 404, array ('error' => array ($e->getMessage ())), @@ -118,6 +122,6 @@ class FrontController { if ($txt == '') { $txt = 'See logs files'; } - exit ('### Application problem ###'."\n".$txt); + exit ('### Application problem ###<br />'."\n".$txt); } } |
