Re: Re: PEAR_Exception in CVS
| From: | Alan Knowles | Date: | Fri, 02 Jul 2004 02:10:12 +0000 |
| Subject: | Re: Re: PEAR_Exception in CVS | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31477@lists.php.net to get a copy of this message | ||
This thinking off the top of my head a bit,
In general, PEAR_Exception at present is nice and simple, and looks like a good lightweight solution for most exception purposes.
Missing from it:
a) printf() type messages for arguments: (needed to enable translatable messages)
Possible solution:?
throw new PEAR_Exception("mymessage", MY_ID)
throw new PEAR_Exception(array("my message %s",$somearg), MY_ID)
b) context exceptions (eg. per package)
Possible solution:?
MyClass_Exception extends PEAR_Exception { }
or is this needed? - as debug_backtrace can grab the classname of the calling class?
c) Stack?
Could this be implemented seperately as a observer?
d) Warnings etc.
- just done by returning PEAR_Exception or a special contructor that flags the object as a warning?
return PEAR_Extension::warning(....);
(and hence MyClass_Extension::warning(....); )
Regards
Alan
Greg Beaver wrote:
My only concern is that all of the code and docs must be marked experimental with big "this may completely change at any moment" signs. Don't make the mistake PEAR.php 1.0 made and commit to BC too early. This is absolutely critical. Greg Hans Lellelid wrote:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comHi Tomas, I'd be happy to write a PEAR_Exception error handling sub-chapter for the manual. I think even if ideas change, it could be a useful starting point for discussion. Thing is, I don't know the first thing about PEAR docs (except that they are written in docbook). Can you point me to where to find current manual in CVS that I can use as an example? Thanks, Hans