Script execution stops at any error!

3 messages Options
Embed this post
Permalink
Bruno Cassol () Script execution stops at any error!
Reply Threaded More More options
Print post
Permalink
Hi,
first of all, FirePHP is a great tool!

I'm having some difficulties making it work. This is how I'm setting it up:

ob_start();

ini_set('scream.enabled', 1);
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

require_once('FirePHPCore/FirePHP.class.php');
$firephp = FirePHP::getInstance(true);
$firephp->registerErrorHandler();
$firephp->registerExceptionHandler();
$firephp->registerAssertionHandler();


Then in the middle of the script, when I try triggering any error it simply flushes the output buffer and apparently stops executing because nothing more is shown in the browser. FirePHP headers are being sent:

$firephp->warn('This is shown in FireBug console');
trigger_error('This ISN'T shown in firebug console', E_ERROR);  // Apparently script stops executing here


When I remove the trigger_error() the scripts execute with success. So I guess the error handler is causing the problem.

I'm using Apache 2 with PHP 5.2.6-3 on Ubuntu.
Any help?
Bruno Cassol () Re: Script execution stops at any error!
Reply Threaded More More options
Print post
Permalink
I found the solution!

I changed this line from:

$firephp->registerErrorHandler();

To:

$firephp->registerErrorHandler(false);

I was telling FirePHP to throw exceptions on errors. I don't understand why that is the default behavior tough.

I hope this helps someone.
Christoph Dorn () Re: Script execution stops at any error!
Reply Threaded More More options
Print post
Permalink
Good to hear it is working now.

The default behavior was inherited to keep backwards compatibility but I think I am going to change that now.

See: http://code.google.com/p/firephp/issues/detail?id=123