Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Christoph Dorn
This would make possible adding a logger object as a listener. There are cases in ZF where an exception is caught and replaced by throwing another one, which is more general. The details and the origin of the error are lost then. It would be nice to be able to log all exceptions in the

Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Lars Strojny
Hi Christoph, hi Peter, Am Mittwoch, den 23.07.2008, 12:26 -0600 schrieb Christoph Dorn: [...] I agree. I have had to comment out higher-level exceptions to figure out what goes on at a lower level. There needs to be an exception stack just like in Java. In 5.3 you can pass the previous

Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Lars Strojny
Am Mittwoch, den 23.07.2008, 20:43 +0200 schrieb Lars Strojny: In 5.3 you can pass the previous exception to the current as the third parameter. The previous exception can than later be retrieved with $exception-getPrevious(). Sorry, sent too early. What I wanted to add was: this could be

Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Christoph Dorn
In 5.3 you can pass the previous exception to the current as the third parameter. The previous exception can than later be retrieved with $exception-getPrevious(). Sorry, sent too early. What I wanted to add was: this could be easily implemented for compatibility in Zend_Exception.

Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Matthew Weier O'Phinney
-- peter fiksman [EMAIL PROTECTED] wrote (on Sunday, 20 July 2008, 11:33 AM +0200): Zend_Exception has currently no content and just extends the standard Excepton class. Maybe it would make sense to add something like addListener(Zend_Observer_Interface $o) method to implement the

Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Christoph Dorn
I've thought that myself a number of times; I actually did exactly this when I was developing Cgiapp (a PHP clone of perl's CGI::Application), and it has a bunch of use cases. You may want to update Development is currently in an active phase on your http://cgiapp.sourceforge.net/ page :)

Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Matthew Weier O'Phinney
-- Christoph Dorn [EMAIL PROTECTED] wrote (on Wednesday, 23 July 2008, 01:10 PM -0600): I've thought that myself a number of times; I actually did exactly this when I was developing Cgiapp (a PHP clone of perl's CGI::Application), and it has a bunch of use cases. You may want to

Re: [fw-general] adding logic to Zend_Exception: observer pattern for logging

2008-07-23 Thread Christoph Dorn
Take a look at the patch: http://lars.schokokeks.org/php/exception-previous-compat.phps It looks completely backwards compatible to me and does not require loading of any additional code. Any new code could chain the exceptions while existing code can be updated over time. This is a reasonable