major custom error handler clash
| From: | daniel at electroteque dot org | Date: | Tue, 13 May 2003 00:10:56 +0000 |
| Subject: | major custom error handler clash | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147377@lists.php.net to get a copy of this message | ||
hi there , i have been rebuilding my classes with their own custom error
handler function and i usually use trigger_error to trigger an error
internally , i have a DB and Auth class which both are used together ,
the constructors in the error classes look like
$GLOBALS['_ERROR_HANDLER_OBJECT_DB'] = &$this;
$GLOBALS['_ERROR_HANDLER_METHOD_DB'] = '_catch';
function db_error_handler($type, $message, $file=null,
$line=null, $vars=null) {
return $GLOBALS['_ERROR_HANDLER_OBJECT_DB']->
$GLOBALS['_ERROR_HANDLER_METHOD_DB']($type,$message, $file, $line, $vars);
}
set_error_handler('db_error_handler');
and in my erorr handler class it looks like
$db_error = new DB_Mysql_Error(true);
$auth_error = new HTTP_Auth_Error;
if i have the auth error after the db , if i get a mysql error the auth
error will be fired, if i switch it around , if i get an auth error the db
error will be fired off , i have to setup the error objects as just setting
up the base classes will not trigger these :\ , this suddenly just
happended this morning where they were only working just the other day ,
what can i do ?