Re: Call for Review: RFC for Error Handling in PHP5 packages

From: Date: Fri, 06 Aug 2004 00:37:59 +0000
Subject: Re: Call for Review: RFC for Error Handling in PHP5 packages
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32468@lists.php.net to get a copy of this message
On Fri, 06 Aug 2004 00:36:19 +0100, Sergio Carvalho <sergio.carvalho@portugalmail.com> wrote: > Hi, > > I'd like to invite everyone interested to review the draft coding > guidelines on the usage of exceptions in PHP5 classes. After this last > review phase, I'll extract the Coding Guidelines section from the > document, and propose the RFC via PEPr. The page is here > > http://wiki.ciaweb.net/yawiki/?area=PEAR_Dev&page=RfcExceptionUse#toc30 > and is world editable. Feel free to add your insights to the Coding > Guidelines section. > Hmmm...there's nothing in Coding Guidelines like the following: You must use Exceptions for code errors. Also, there's no mention of the possiblity of returning status codes instead of throwing an Exception. See discussion: http://wiki.ciaweb.net/yawiki/?area=PEAR_Dev&page=RfcExceptionUse#toc27 IMHO, all failures should be required to be an exception. Return values for statuses may be used, but if functions such as checkAuthentication(), not authenticate(). If you call authenticate(), you're assuming the function *will* authenticate. If it fails, it is nto doing what the function says it will do....namely authenticate. > I'll take the chance to say I'm sorry for the delay in taking this text > to the final stage. I've been putting out virtual fires for two weeks > now -- things are calming down, though. > > Cheers, > > Sérgio Carvalho > > > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

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