more error support to event handler

This commit is contained in:
luis daniel lucio quiroz 2015-01-04 04:08:38 +00:00
parent cc4009670a
commit 68a477f5eb
1 changed files with 6 additions and 2 deletions

View File

@ -33,8 +33,12 @@ if (!class_exists('database')) {
public function execute_event($event_type, $params=null){
foreach ($this->event[$event_type] as $event_function){
try{
call_user_func($event_function, $params);
}
catch (Exception $e) {
echo 'Exception: ', $e->getMessage(), "\n";
}
// Lets log
foreach ($this->handler as $handler){
$handler->log_event($event_type, $params);