Re: DB_DataObject->update()
| From: | Ian Eure | Date: | Thu, 11 Dec 2003 19:31:23 +0000 |
| Subject: | Re: DB_DataObject->update() | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24348@lists.php.net to get a copy of this message | ||
On Wednesday 10 December 2003 07:55 am, Marcos Neves wrote:
> I 'm having problems to handle errors. Can somebody give a light.
>
> I don't consider an error "No Data Affected By update"
> raised by DB_DataObject->update(). How you people handle this?
>
I commented out the line. :^)
> The hole code call DB_DataObject::raiseError, so how can I extends this?
> The same goes to debug() method.
>
> I use a custom error_handler if it's matter
>
You could overload update(), with something like:
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$res = parent::update();
if(PEAR::isError($res) && $res->getMessage() == 'No Data...') {
return true; // (or whatever)
}
PEAR::popErrorHandling();
return $res;