Catching errors in DB_DataObject
| From: | Phil Gyford | Date: | Fri, 19 Nov 2004 11:34:07 +0000 |
| Subject: | Catching errors in DB_DataObject | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15673@lists.php.net to get a copy of this message | ||
Hi,
I'm new to PEAR, so if this or future questions are too dumb, or the
answer's easily found elsewhere, do tell me!
I'm using DB_DataObject successfully at the moment, but although I've
read through much of the documentation and its handy examples, I'm not
sure how best to catch things that go wrong. For example, if I do
this:
$person = new DataObjects_Person();
$person->get( $id );
$person->myCustomFunction();
I want to make sure $person has been created with a valid id before I
go on to doing stuff with myCustomFunction(). I'm not clear how best
to check things haven't failed. Do I (somehow) use PEAR::Error, which
I'm having problems understanding...?
Any help much appreciated.
Thanks,
Phil