RE: [PEAR] Dobjects Error Thowing

From: Date: Tue, 17 Jun 2003 14:34:24 +0000
Subject: RE: [PEAR] Dobjects Error Thowing
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6045@lists.php.net to get a copy of this message
Hi (again), $dbCapture->_lastError->getMessage(); works fine. However I always though attributes starting with '_' were meant to imply private. Is there not some wrapper interface (Pear error i thought?) to provide a clean way to access the error attributes? Regards, Mike C. -----Original Message----- From: LIMBOURG Arnaud [mailto:arnaud.limbourg.prestataire@cegetel.fr] Sent: 17 June 2003 13:25 To: Mike Carter; pear-general@lists.php.net Subject: RE: [PEAR] Dobjects Error Thowing > Hi, > > I'm just testing my failsafe code for when a > DataObject::insert() fails. > The method seems to just return key value/false. Yet the > documentation @ > http://devel.akbkhome.com/peardoc2/package.database.db-dataobj > ect.db-dataobj > ect.insert.html indicates that an error is thrown. How do I > catch the error > in PEAR/PHP ? > > $dbResult = $dbCapture->insert(); > Var_dump(PEAR::isError($dbResult)); if (!$dbResult) { die($dbCapture->last_error->getMessage()); } At least that is what i understood from the code. Arnaud. ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.489 / Virus Database: 288 - Release Date: 6/10/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.489 / Virus Database: 288 - Release Date: 6/10/2003 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

« previous php.pear.general (#6045) next »