Re: MDB2 global error handling

From: Date: Wed, 19 Dec 2007 06:35:03 +0000
Subject: Re: MDB2 global error handling
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28360@lists.php.net to get a copy of this message
Hello Douglas, > > 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. > do based off the error code). At any rate, with the driver and code > I'm using die()ing would be fine - I just don't want to have to write > a wrapper around MDB2 in order to have errors handled in a central > location. Set the PEAR error handler to exception, and an exception is thrown whenever an error occurs. You can also specify a callback as error handler. See the PEAR.php class -- Regards/Mit freundlichen Grüßen Christian Weiske

Attachment: [application/pgp-signature] signature.asc
« previous php.pear.general (#28360) next »