[surforce-library commit] r36 - trunk/library/Zsurforce/Generic

1 view
Skip to first unread message

codesite...@google.com

unread,
Jan 21, 2009, 1:33:03 PM1/21/09
to surforce...@googlegroups.com
Author: enriqueplace
Date: Wed Jan 21 08:29:05 2009
New Revision: 36

Modified:
trunk/library/Zsurforce/Generic/ControllerAdmin.php

Log:
Agrega manejo de excepciones en caso de fallo al recuperar datos del menú

Modified: trunk/library/Zsurforce/Generic/ControllerAdmin.php
==============================================================================
--- trunk/library/Zsurforce/Generic/ControllerAdmin.php (original)
+++ trunk/library/Zsurforce/Generic/ControllerAdmin.php Wed Jan 21 08:29:05
2009
@@ -21,14 +21,32 @@
*/
final function preDispatch()
{
- $auth = Zend_Auth::getInstance ();
+ $auth = Zend_Auth::getInstance();

if ($auth->hasIdentity ()) {
$this->view->usuarioLogueado = true;

/* Genera el menú dinámico para el sistema de admin */
- $layout = Zend_Layout::getMvcInstance();
- $layout->menu =
Models_Menu::getMenu($this->_registry->config->general->appid);
+ try{
+
+ $layout = Zend_Layout::getMvcInstance();
+ $layout->menu =
Models_Menu::getMenu($this->_registry->config->general->appid);
+
+ }catch(Zend_Db_Statement_Exception $e){
+ $this->view->mensajeError =
+ 'Se ha producido un error al intentar recuperar los
datos <br><br>'
+ .'['.$e->getMessage().']<br><br>'
+ .' Por favor envíe un email a
sistemas '.$this->_config->general->email ;
+ }catch(Zend_Db_Adapter_Exception $e){
+ $this->view->mensajeError =
+ 'Se ha producido un error al conectar a la base de
datos.'
+ .' Por favor reintente en unos minutos';
+ }catch(Exception $e){
+ $this->view->mensajeError =
+ 'Se ha producido un error inesperado.'
+ .' Por favor reintente en unos minutos';
+ }
+
}else {
$this->_redirect('/admin/login/');
return;
Reply all
Reply to author
Forward
0 new messages