Exception handling is broken

For programming and general questions on Zend Framework

Exception handling is broken

Postby simpli on Wed Jun 10, 2009 3:34 am

Hi,
I have an error in my application but I cannot debug it because the exception capturing seems to be broken. Before, when there was a problem I would get a whole trace that would help me pinpoint where the error occured. Now all I get is
message ?>
Exception information:

Message: exception->getMessage() ?>
Stack trace:

exception->getTraceAsString() ?>


Request Parameters:

request->getParams()) ?>

I started nothing this when I installed Marc Liyanage's Php5 package. Could something have been broken when I installed the package? Everything is working well but it's kinda hard to debug when you can't get a screen dump.
Any help will be grealy appreciated.
Thank you,
JR
simpli
 
Posts: 33
Joined: Sat Jun 06, 2009 9:40 pm

Re: Exception handling is broken

Postby cezmunsta on Wed Jun 10, 2009 8:58 am

Hi,

It looks like you have PHP short opening tags turned off.

Try changing the code in the error template (views/scripts/error/error.phtml by default) to:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Zend Framework Default Application</title>
</head>
<body>
  <h1>An error occurred</h1>
  <h2><?php echo $this->message ?></h2>

  <?php if ('development' == APPLICATION_ENV): ?>

  <h3>Exception information:</h3>
  <p>
      <b>Message:</b> <?php echo $this->exception->getMessage() ?>
  </p>

  <h3>Stack trace:</h3>
  <pre><?php echo $this->exception->getTraceAsString() ?>
  </pre>

  <h3>Request Parameters:</h3>
  <pre><?php var_dump($this->request->getParams()) ?>
  </pre>
  <?php endif ?>

</body>
</html>



..or, modify it to suit your application, but keep the full opening tags.

Regards,

Ceri
----
C
cezmunsta
 
Posts: 60
Joined: Wed Apr 15, 2009 12:41 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 5 guests