Re: [PEPr] Comment on Web Services::Services_Memotoo
| From: | till | Date: | Thu, 24 Apr 2008 17:39:43 +0000 |
| Subject: | Re: [PEPr] Comment on Web Services::Services_Memotoo | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49885@lists.php.net to get a copy of this message | ||
On Thu, Apr 24, 2008 at 7:10 PM, Thomas Pequet <webmaster@memotoo.com> wrote:
>
> Ok Philippe and Till I have added this syntax in my code:
> catch (SoapFault $e) {
> throw new Services_Memotoo_Exception($e->faultstring, (int)$e->faultcode);
> }
> and change the return value.
>
> Till, I don't know why you don't see the packages.xml file in the tgz file
> because I use "pear package" to create it and normally if you follow this
> link you can see the packages.xml file:
> ->
>
> http://www.memotoo.com/softs/?dossier=PEAR_Services_Memotoo&action=afficherfic&fic=Services_Memotoo-lasted.tgzV
> œÓšï¯qM;ƒWÄ
I download it, but it's only 6.5k now and I can't extract it, nor install it:
-rw-r--r-- 1 root wheel 6.5K Apr 24 19:36 Services_Memotoo-lasted.tgz
> ("lasted" is correct ? normally if my english is good, "lasted" is
> "the
> last version" )
If you don't mind me being picky, it should be latest. :-)
Also, if you created the .tgz with "pear package", it would be
"Services_Memotoo-0.2.0.tgz".
> I don't know how to set constant error in my Exception class ? Can you give
> an example ???
A simple example:
class Services_Memotoo
{
...
const ERR_SOAP = 123;
}
When throwing a soap-related error:
throw new Services_Memotoo_Exception("message", self::ERR_SOAP);
Then you check outside...
try {
} catch (Services_Memotoo_Exception $e) {
if ($e->getCode() == Services_Memotoo::ERR_SOAP) {
echo 'Soap error: ' . $e->getMessage();
}
}
You can also check here:
<http://code.google.com/p/services-projecthoneypot/source/browse/trunk/Services/ProjectHoneyPot.php>
Cheers,
Till