PEAR error handling question

From: Date: Sun, 26 Jan 2003 21:38:46 +0000
Subject: PEAR error handling question
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-12762@lists.php.net to get a copy of this message
Hi, is something like this allowed, or is the only allowed way to handle errors: http://pear.php.net/manual/en/class.pear.php: class Bla extends PEAR {
    var $pear_error;
    function foo()
    {
        ...
        if ($success) {
            return true;
        } else {
            $this->pear_error = $this->raiseError('error 99 change user');
            return false;
        }
    }
} $blo = new Bla; if (!$blo->foo()) {
    echo $blo->pear_error->getMessage();
} bye, -- ------------------------------- ------------------------------------- Michael Bretterklieber - Michael.Bretterklieber@jawa.at JAWA Management Software GmbH - http://www.jawa.at Liebenauer Hauptstr. 200 -------------- privat --------------- A-8041 GRAZ GSM: ++43-(0)676-93 96 698 Tel: ++43-(0)316-403274-12 E-mail: michael@bretterklieber.com Fax: ++43-(0)316-403274-10 http://www.bretterklieber.com ------------------------------- ------------------------------------- "...the number of UNIX installations has grown to 10, with more expected..." - Dennis Ritchie and Ken Thompson, June 1972

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