views:

889

answers:

4

By default error page in ZF looks like this:

*Fatal error: Uncaught exception 'Zend_Form_Exception' with message 'Method setDeault does not exist' in /usr/home/.../library/Zend/Form.php:2838 Stack trace: #0 [internal function]: Zend_Form->__call('setDeault', Array) #1 /usr/home/.../application/admin/controllers/TagsController.php(40): Web_Form_Admintags->setDeault('tagstext', '....') #2 /usr/home/.../library/Zend/*

Is there any ways to change this messy error description to more clearly form (something like Django error page)?

+1  A: 

This is not an error page but a standard PHP output for uncaught exceptions. As far as I know there is no default error page in Zend Framework -- you will have to create your own by creating an appropriate view for the ErrorController.

Ferdinand Beyer
+1  A: 

AFAICR this is using the Error controller right? That message is basically the dump of the exception object. You can split this up by calling different parts individually rather than dumping the whole lot as a string. See the manual page I linked to.

Make sure you're only providing exception information when the APPLICATION_ENVIRONMENT is set to development as well.

Ross
A: 

The exception is formatted using new lines, which are however not transformed to
in html. You have several options...

  1. Wrap the error with <pre></pre> tags
  2. Create custom exception handler

 

function exception_handler($exception) {
  echo "Uncaught exception: " , $exception->getMessage(), "\n";
}

set_exception_handler('exception_handler');
michal kralik
A: 

Create an Error Controller/View in Zend Framework

That link should help you accomplish what you want.

leek