Re: [PEPr] Comment on XML::XML_FastCreate
| From: | Cipriano Groenendal | Date: | Mon, 19 Apr 2004 09:22:45 +0000 |
| Subject: | Re: [PEPr] Comment on XML::XML_FastCreate | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-27992@lists.php.net to get a copy of this message | ||
> >
> > 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 :)
Cipri