Re: MDB2 global error handling

From: Date: Mon, 17 Dec 2007 20:51:41 +0000
Subject: Re: MDB2 global error handling
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28341@lists.php.net to get a copy of this message
On Dec 17, 2007 11:58 AM, Douglas E. Warner <silfreed-nabble@silfreed.net> wrote: > > Rather than having to call PEAR::isError() on each result from an MDB2 call, > is there a way to set a global error handler to catch all these errors? > > I already have a PEAR error handler set using: > <?php > PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array('MyError', > 'Handle_Pear')); > ?> This should work just fine. The problem is that if you can't really handle the errors in this callback. For instance, if you wanted to show a special message about where the failure happened or do a rollback. This should work fine if you just want to die() with the error, though. > > And I've tried setting this on my MDB2 object (created by a MDB2::factory() > call). Any other suggestions? > > -Doug > -- > View this message in context: > http://www.nabble.com/MDB2-global-error-handling-tp14374020p14374020.html > Sent from the Pear - General mailing list archive at Nabble.com. > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

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