php - set_exception_handler not working -
i'm working on small site has custom error handling (or, rather error visualization) , i'm having issue function involves both error , exception catching.
so, have code:
<? $query = sql::query("select * sitevars"); if ( !$query ) { kernel::log('could not retrieve sitevars.', 3, true); return false; }
as can see, supposed use kernel::log
method if query false kernel::log
block takes care of launching exception if third argument equal true written follows:
<? if ( $kill ) { $backtrace = debug_backtrace(); $caller = array_shift($backtrace); echo "test"; throw new exception($message." near line ".$caller['line']." on file ".$caller['file']); }
now, issue that, though test
printed, exception handler not called. set exception handler on __construct
method of kernel
class
<? public function __construct() { global $config; self::$modlist = array('kernel'); spl_autoload_register('kernel::loadmodule'); register_shutdown_function('kernel::shutdown'); set_exception_handler('kernel::exception'); set_error_handler('kernel::error', e_all); }
now, i've triggered errors on other files, know @ least error handler working, but, though i've executed throw new exception('test')
on various files, none of exceptions caught.
why happening?
Comments
Post a Comment