Re: PEAR_Error class

From: Date: Mon, 26 May 2003 13:05:57 +0000
Subject: Re: PEAR_Error class
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16704@lists.php.net to get a copy of this message
cagrET wrote:
I have own DB class and DB_Error class which extends PEAR_Error sidenote: better name the error class myDB_Error or so, DB_Error is alreay the name of the Error class of the PEAR-DB class
What about this solution: You have already a own error class, why not doing something like this: PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "errorfunc"); ..... function errorfunc($pe) { if('myDB_Error'==get_class($pe) { // error caused by your DB class } else { // handle errors of other classes throwing a PEAR error } }

« previous php.pear.dev (#16704) next »