Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour,
Lors d'une exception, le "stack trace" est affiché sans retour ligne (ou plus exactement sans <br /> dans le code html généré).
Il y a-t-il une option pour avoir un affichage plus lisible ?
Cdt,
Eric.
Hors ligne
function toto($e)
{
echo wordwrap($e, 10, '<br />');
}
set_exception_handler('toto');
Par exemple
Hors ligne
L'autre solution c'est de regarder le code source de ta page, tu as bien les retours à la ligne de ta stack
A+, Philippe
Hors ligne
Code affiché:
Fatal error: Uncaught exception 'Zend_Controller_Action_Exception' with message 'Action "forgotsend" does not exist and was not trapped in __call()' in C:\wamp\ZF\Zend\Controller\Action.php:474 Stack trace: #0 C:\wamp\ZF\Zend\Controller\Action.php(505): Zend_Controller_Action->__call('forgotsendActio...', Array) #1 C:\wamp\ZF\Zend\Controller\Dispatcher\Standard.php(285): Zend_Controller_Action->dispatch('forgotsendActio...') #2 C:\wamp\ZF\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #3 C:\wamp\www\hrs5\app_hrs\bootstrap.php(55): Zend_Controller_Front->dispatch() #4 C:\wamp\www\hrs5\index.php(22): require('C:\wamp\www\hrs...') #5 {main} thrown in C:\wamp\ZF\Zend\Controller\Action.php on line 474
Code HTML:
<br />
<b>Fatal error</b>: Uncaught exception 'Zend_Controller_Action_Exception' with message 'Action "forgotsend" does not exist and was not trapped in __call()' in C:\wamp\ZF\Zend\Controller\Action.php:474
Stack trace:
#0 C:\wamp\ZF\Zend\Controller\Action.php(505): Zend_Controller_Action->__call('forgotsendActio...', Array)
#1 C:\wamp\ZF\Zend\Controller\Dispatcher\Standard.php(285): Zend_Controller_Action->dispatch('forgotsendActio...')
#2 C:\wamp\ZF\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#3 C:\wamp\www\hrs5\app_hrs\bootstrap.php(55): Zend_Controller_Front->dispatch()
#4 C:\wamp\www\hrs5\index.php(22): require('C:\wamp\www\hrs...')
#5 {main}
thrown in <b>C:\wamp\ZF\Zend\Controller\Action.php</b> on line <b>474</b><br />
Il n'y pas les <br /> au bout de chaque ligne.
Hors ligne
Merci Julien pour ton exemple.
Il ne fonctionne pas (ça coupe la ligne tous les 10 caractères), mais je m'en suis inspiré pour trouver la solution :
function exception_handler($e)
{
$order = array("\r\n", "\n", "\r");
$replace = '<br />';
// Traitement du premier \r\n, ils ne seront pas convertis deux fois.
echo str_replace($order, $replace, $e);
}
set_exception_handler('exception_handler');
Eric.
Hors ligne
Pages: 1