Re: [PEPr] Comment on XML::XML_FastCreate
| From: | Guillaume Lecanu | Date: | Mon, 19 Apr 2004 09:46:42 +0000 |
| Subject: | Re: [PEPr] Comment on XML::XML_FastCreate | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-27999@lists.php.net to get a copy of this message | ||
Le lun 19/04/2004 à 11:22, Cipriano Groenendal a écrit :
> > >
> > > 3. Error reporting
> > > Please use PEAR::raiseError() or the new Error_Stack to report errors,
> > > instead of a switch/case statement.
> > Humm i have a doubt, is it possible to control the format output with
> > raiseError, by example for XHTML (a special div) ?
>
> That's the good thing about raiseError.
> You don't print an error, or return it, in any specific way. What you do is
> you define() a code, and return a PEAR::Error object with both the code and
> the message. That way, the developer can check if what he got returned was a
> valid XML_FastCreate object, or a PEAR::Error object, and act according to
> how he wants :)
> If you check the CVS, you'll see there's quite a few packages aroudn that
> handle it this way, such as the DB package :)
Ok i will change that, thanks :)
>
> Cipri