Re: Re: [PEPr] Comment on Networking::GeoIP

From: Date: Wed, 16 Jun 2004 12:13:18 +0000
Subject: Re: Re: [PEPr] Comment on Networking::GeoIP
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30762@lists.php.net to get a copy of this message
Hello Mike, thanks for your help ;) quick follow up: so e.g. if (!@$scanned) {
            return PEAR::raiseError(self::MP3_PLAYLIST_OPENDIR_FAILED,
                                    -1, PEAR_ERROR_PRINT);
        }
can be re-written as if (!@!@$scanned) {
            throw new Exception(self::MP3_PLAYLIST_OPENDIR_FAILED);
        }
right ? Cheers David Costa On Jun 16, 2004, at 2:01 PM, Michael Wallner wrote:
Hi David Costa, you wrote:
Perhaps (If you are really bored :-D) you can tell me how would that change on my source for errors handling ? ;)
Oh David :) try { $obj->doSth()->more(); } catch (Exception $ex) { echo "<pre>"; echo $ex; echo "</pre>"; } instead of: $rs = &$obj->doSth(); if (is_a($rs, 'PEAR_Error')) { die($rs->getMessage()); } $rs2 = $rs->more(); if (is_a($rs2, 'PEAR_Error')) { die($rs2->getMessage()); } Regards, -- Michael - < mike(@)php.net >


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