Re: How to use PHP 4 classes with exceptions?

From: Date: Mon, 30 May 2005 19:38:03 +0000
Subject: Re: How to use PHP 4 classes with exceptions?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19423@lists.php.net to get a copy of this message
Sven Drieling wrote:
So at the moment I'm just using a PEAR error handler to throw exceptions PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pearErrorHandler'); function pearErrorHandler($error) {
      throw new Exception($error->getMessage() . ' -- ' . $error->getDebugInfo());
}
        but using PEAR::setErrorHandling(PEAR_ERROR_EXCEPTION) would be easier.
With a difference of 3 extra lines, I don't see how this is difficult, less efficient, or inappropriate. I think your solution is the best one and shows the true flexibility of the PEAR_ERROR_CALLBACK and callbacks in general. Greg

« previous php.pear.general (#19423) next »