php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44101 Better explanation of expected behavior
Submitted: 2008-02-11 22:08 UTC Modified: 2008-02-14 22:42 UTC
From: johnston dot joshua at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.5 OS: any
Private report: No CVE-ID: None
 [2008-02-11 22:08 UTC] johnston dot joshua at gmail dot com
Description:
------------
When an exception is thrown and not caught and html_errors = on the Fatal Error text is only partially formatted. When you 'view source' in your web browser you can see the stact trace is nicely formatted but has no format for content-type: text/html

Actual result:
--------------
<br />
<b>Fatal error</b>:  Uncaught exception 'Zend_Controller_Action_Exception' with message 'Portal_TrialController::helloAction() does not exist and was not trapped in __call()' in /code/dev/php/Zend/Controller/Action.php:480
Stack trace:
#0 [internal function]: Zend_Controller_Action-&gt;__call('helloAction', Array)
#1 /code/dev/php/Zend/Controller/Action.php(497): Portal_TrialController-&gt;helloAction()
#2 /code/dev/php/Zend/Controller/Dispatcher/Standard.php(238): Zend_Controller_Action-&gt;dispatch('helloAction')
#3 /code/dev/php/Zend/Controller/Front.php(920): Zend_Controller_Dispatcher_Standard-&gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#4 /home/jjohnston/svn/dev/www/bootstrap.php(96): Zend_Controller_Front-&gt;dispatch()
#5 /home/jjohnston/svn/dev/www/bootstrap.php(6): MailWise_Bootstrap::main()
#6 {main}
  thrown in <b>/code/dev/php/Zend/Controller/Action.php</b> on line <b>480</b><br />

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-13 16:53 UTC] jani@php.net
Exactly what is not right there?
 [2008-02-13 19:38 UTC] johnston dot joshua at gmail dot com
The Exception and Fatal Error work just fine. I am reporting this as a bug because error output has newlines in it but the HTML display does not reflect this format. I would expect the stack trace would be wrapped in <pre></pre> or even some sort of list so that it is readable in HTML output instead of all run together.

If you view it in a browser you see:

Stack trace:#0 [internal function]: Zend_Controller_Action->__call('helloAction',
Array) #1 /code/dev/php/Zend/Controller/Action.php(497):Portal_TrialController->helloAction() #2 /code/dev/php/Zend/Controller/Dispatcher/Standard.php(238):Zend_Controller_Action->dispatch('helloAction') #3 /code/dev/php/Zend/Controller/Front.php(920):Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 /home/jjohnston/svn/dev/www/bootstrap.php(96): Zend_Controller_Front->dispatch() #5 /home/jjohnston/svn/dev/www/bootstrap.php(6): MW_Bootstrap::main() #6 {main}  thrown in <b>/code/dev/php/Zend/Controller/Action.php</b> on line

Notice the text is displayed in a long line without any visual separation. This is true of any thrown but not caught Exception, not Zend Framework specific.

The error message does add a <br /> before and after the error text.
 [2008-02-14 22:42 UTC] jani@php.net
It's expected. If you wish to print out exceptions in your website in pretty form, then you need to add <pre> tags or whatever around the place where the output happens. Normally you do catch every exception..and normally you do log errors and not output them on the webpage.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 30 16:00:02 2025 UTC