Re: Re: PEAR_Exception - some refactoring

From: Date: Sat, 28 Aug 2004 22:16:43 +0000
Subject: Re: Re: PEAR_Exception - some refactoring
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-33022@lists.php.net to get a copy of this message
Bertrand Mansion wrote: >Stephan Schmidt wrote: > >>I guess Greg is talking of: >> >><?PHP >>require_once 'PEAR/Exception.php'; >>try { >> throw new PEAR_EXception('I\'m an exception in the global context'); >>} catch (Exception $e){ >> echo $e; >>} >>?> > >I see. There is no trace information in this context so the methods will have >to figure it out in a way or another. I will try to find a solution. The code >as it is now in CVS is also not working in this context, so that's a good >opportunity to fix it. I have updated the code at: <http://www.mamasam.com/pear/Exception.phps> The snippet above is now supported (global context, no trace available from Exception) thanks to the use of function debug_backtrace(). I had to add a new getTraceSafe() method specifically for that case. I have also added a new toText() method to get a plain text version of the trace along with causes messages. Let me know if you have any other ideas, comments, critics. TIA, Bertrand Mansion Mamasam

« previous php.pear.dev (#33022) next »